Renderer.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931
  1. import Animation from './Animation.js';
  2. import RenderObjects from './RenderObjects.js';
  3. import Attributes from './Attributes.js';
  4. import Geometries from './Geometries.js';
  5. import Info from './Info.js';
  6. import Pipelines from './Pipelines.js';
  7. import Bindings from './Bindings.js';
  8. import RenderLists from './RenderLists.js';
  9. import RenderContexts from './RenderContexts.js';
  10. import Textures from './Textures.js';
  11. import Background from './Background.js';
  12. import Nodes from './nodes/Nodes.js';
  13. import { Scene, Frustum, Matrix4, Vector2, Vector3, Vector4, Color, DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoToneMapping } from 'three';
  14. const _scene = new Scene();
  15. const _drawingBufferSize = new Vector2();
  16. const _screen = new Vector4();
  17. const _frustum = new Frustum();
  18. const _projScreenMatrix = new Matrix4();
  19. const _vector3 = new Vector3();
  20. class Renderer {
  21. constructor( backend ) {
  22. this.isRenderer = true;
  23. // public
  24. this.domElement = backend.getDomElement();
  25. this.backend = backend;
  26. this.autoClear = true;
  27. this.autoClearColor = true;
  28. this.autoClearDepth = true;
  29. this.autoClearStencil = true;
  30. this.outputColorSpace = SRGBColorSpace;
  31. this.toneMapping = NoToneMapping;
  32. this.toneMappingExposure = 1.0;
  33. this.sortObjects = true;
  34. this.depth = true;
  35. this.stencil = true;
  36. this.info = new Info();
  37. // internals
  38. this._pixelRatio = 1;
  39. this._width = this.domElement.width;
  40. this._height = this.domElement.height;
  41. this._viewport = new Vector4( 0, 0, this._width, this._height );
  42. this._scissor = new Vector4( 0, 0, this._width, this._height );
  43. this._scissorTest = false;
  44. this._properties = null;
  45. this._attributes = null;
  46. this._geometries = null;
  47. this._nodes = null;
  48. this._bindings = null;
  49. this._objects = null;
  50. this._pipelines = null;
  51. this._renderLists = null;
  52. this._renderContexts = null;
  53. this._textures = null;
  54. this._background = null;
  55. this._animation = new Animation();
  56. this._currentRenderContext = null;
  57. this._lastRenderContext = null;
  58. this._opaqueSort = null;
  59. this._transparentSort = null;
  60. this._clearAlpha = 1;
  61. this._clearColor = new Color( 0x000000 );
  62. this._clearDepth = 1;
  63. this._clearStencil = 0;
  64. this._renderTarget = null;
  65. this._activeCubeFace = 0;
  66. this._activeMipmapLevel = 0;
  67. this._initialized = false;
  68. this._initPromise = null;
  69. // backwards compatibility
  70. this.shadowMap = {
  71. enabled: false,
  72. type: null
  73. };
  74. this.xr = {
  75. enabled: false
  76. };
  77. }
  78. async init() {
  79. if ( this._initialized ) {
  80. throw new Error( 'Renderer: Backend has already been initialized.' );
  81. }
  82. if ( this._initPromise !== null ) {
  83. return this._initPromise;
  84. }
  85. this._initPromise = new Promise( async ( resolve, reject ) => {
  86. const backend = this.backend;
  87. try {
  88. await backend.init( this );
  89. } catch ( error ) {
  90. reject( error );
  91. return;
  92. }
  93. this._nodes = new Nodes( this, backend );
  94. this._attributes = new Attributes( backend );
  95. this._background = new Background( this, this._nodes );
  96. this._geometries = new Geometries( this._attributes, this.info );
  97. this._textures = new Textures( backend, this.info );
  98. this._pipelines = new Pipelines( backend, this._nodes );
  99. this._bindings = new Bindings( backend, this._nodes, this._textures, this._attributes, this._pipelines, this.info );
  100. this._objects = new RenderObjects( this, this._nodes, this._geometries, this._pipelines, this._bindings, this.info );
  101. this._renderLists = new RenderLists();
  102. this._renderContexts = new RenderContexts();
  103. //
  104. this._animation.setNodes( this._nodes );
  105. this._animation.start();
  106. this._initialized = true;
  107. resolve();
  108. } );
  109. return this._initPromise;
  110. }
  111. get coordinateSystem() {
  112. return this.backend.coordinateSystem;
  113. }
  114. async compile( /*scene, camera*/ ) {
  115. console.warn( 'THREE.Renderer: .compile() is not implemented yet.' );
  116. }
  117. async render( scene, camera ) {
  118. if ( this._initialized === false ) await this.init();
  119. // preserve render tree
  120. const nodeFrame = this._nodes.nodeFrame;
  121. const previousRenderId = nodeFrame.renderId;
  122. const previousRenderState = this._currentRenderContext;
  123. //
  124. const sceneRef = ( scene.isScene === true ) ? scene : _scene;
  125. const renderTarget = this._renderTarget;
  126. const renderContext = this._renderContexts.get( scene, camera, renderTarget );
  127. const activeCubeFace = this._activeCubeFace;
  128. const activeMipmapLevel = this._activeMipmapLevel;
  129. this._currentRenderContext = renderContext;
  130. nodeFrame.renderId ++;
  131. //
  132. const coordinateSystem = this.coordinateSystem;
  133. if ( camera.coordinateSystem !== coordinateSystem ) {
  134. camera.coordinateSystem = coordinateSystem;
  135. camera.updateProjectionMatrix();
  136. }
  137. //
  138. if ( this._animation.isAnimating === false ) nodeFrame.update();
  139. if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
  140. if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
  141. if ( this.info.autoReset === true ) this.info.reset();
  142. this.info.render.frame ++;
  143. //
  144. let viewport = this._viewport;
  145. let scissor = this._scissor;
  146. let pixelRatio = this._pixelRatio;
  147. if ( renderTarget !== null ) {
  148. viewport = renderTarget.viewport;
  149. scissor = renderTarget.scissor;
  150. pixelRatio = 1;
  151. }
  152. this.getDrawingBufferSize( _drawingBufferSize );
  153. _screen.set( 0, 0, _drawingBufferSize.width, _drawingBufferSize.height );
  154. const minDepth = ( viewport.minDepth === undefined ) ? 0 : viewport.minDepth;
  155. const maxDepth = ( viewport.maxDepth === undefined ) ? 1 : viewport.maxDepth;
  156. renderContext.viewportValue.copy( viewport ).multiplyScalar( pixelRatio ).floor();
  157. renderContext.viewportValue.width >>= activeMipmapLevel;
  158. renderContext.viewportValue.height >>= activeMipmapLevel;
  159. renderContext.viewportValue.minDepth = minDepth;
  160. renderContext.viewportValue.maxDepth = maxDepth;
  161. renderContext.viewport = renderContext.viewportValue.equals( _screen ) === false;
  162. renderContext.scissorValue.copy( scissor ).multiplyScalar( pixelRatio ).floor();
  163. renderContext.scissor = this._scissorTest && renderContext.scissorValue.equals( _screen ) === false;
  164. renderContext.scissorValue.width >>= activeMipmapLevel;
  165. renderContext.scissorValue.height >>= activeMipmapLevel;
  166. renderContext.depth = this.depth;
  167. renderContext.stencil = this.stencil;
  168. //
  169. sceneRef.onBeforeRender( this, scene, camera, renderTarget );
  170. //
  171. _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
  172. _frustum.setFromProjectionMatrix( _projScreenMatrix, coordinateSystem );
  173. const renderList = this._renderLists.get( scene, camera );
  174. renderList.begin();
  175. this._projectObject( scene, camera, 0, renderList );
  176. renderList.finish();
  177. if ( this.sortObjects === true ) {
  178. renderList.sort( this._opaqueSort, this._transparentSort );
  179. }
  180. //
  181. if ( renderTarget !== null ) {
  182. this._textures.updateRenderTarget( renderTarget, activeMipmapLevel );
  183. const renderTargetData = this._textures.get( renderTarget );
  184. renderContext.textures = renderTargetData.textures;
  185. renderContext.depthTexture = renderTargetData.depthTexture;
  186. renderContext.width = renderTargetData.width;
  187. renderContext.height = renderTargetData.height;
  188. } else {
  189. renderContext.textures = null;
  190. renderContext.depthTexture = null;
  191. renderContext.width = this.domElement.width;
  192. renderContext.height = this.domElement.height;
  193. }
  194. renderContext.width >>= activeMipmapLevel;
  195. renderContext.height >>= activeMipmapLevel;
  196. renderContext.activeCubeFace = activeCubeFace;
  197. renderContext.activeMipmapLevel = activeMipmapLevel;
  198. renderContext.occlusionQueryCount = renderList.occlusionQueryCount;
  199. //
  200. this._nodes.updateScene( sceneRef );
  201. //
  202. this._background.update( sceneRef, renderList, renderContext );
  203. //
  204. this.backend.beginRender( renderContext );
  205. // process render lists
  206. const opaqueObjects = renderList.opaque;
  207. const transparentObjects = renderList.transparent;
  208. const lightsNode = renderList.lightsNode;
  209. if ( opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
  210. if ( transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );
  211. // finish render pass
  212. this.backend.finishRender( renderContext );
  213. // restore render tree
  214. nodeFrame.renderId = previousRenderId;
  215. this._currentRenderContext = previousRenderState;
  216. this._lastRenderContext = renderContext;
  217. //
  218. sceneRef.onAfterRender( this, scene, camera, renderTarget );
  219. }
  220. getActiveCubeFace() {
  221. return this._activeCubeFace;
  222. }
  223. getActiveMipmapLevel() {
  224. return this._activeMipmapLevel;
  225. }
  226. setAnimationLoop( callback ) {
  227. if ( this._initialized === false ) this.init();
  228. const animation = this._animation;
  229. animation.setAnimationLoop( callback );
  230. ( callback === null ) ? animation.stop() : animation.start();
  231. }
  232. getArrayBuffer( attribute ) { // @deprecated, r155
  233. console.warn( 'THREE.Renderer: getArrayBuffer() is deprecated. Use getArrayBufferAsync() instead.' );
  234. return this.getArrayBufferAsync( attribute );
  235. }
  236. async getArrayBufferAsync( attribute ) {
  237. return await this.backend.getArrayBufferAsync( attribute );
  238. }
  239. getContext() {
  240. return this._context;
  241. }
  242. getPixelRatio() {
  243. return this._pixelRatio;
  244. }
  245. getDrawingBufferSize( target ) {
  246. return target.set( this._width * this._pixelRatio, this._height * this._pixelRatio ).floor();
  247. }
  248. getSize( target ) {
  249. return target.set( this._width, this._height );
  250. }
  251. setPixelRatio( value = 1 ) {
  252. this._pixelRatio = value;
  253. this.setSize( this._width, this._height, false );
  254. }
  255. setDrawingBufferSize( width, height, pixelRatio ) {
  256. this._width = width;
  257. this._height = height;
  258. this._pixelRatio = pixelRatio;
  259. this.domElement.width = Math.floor( width * pixelRatio );
  260. this.domElement.height = Math.floor( height * pixelRatio );
  261. this.setViewport( 0, 0, width, height );
  262. if ( this._initialized ) this.backend.updateSize();
  263. }
  264. setSize( width, height, updateStyle = true ) {
  265. this._width = width;
  266. this._height = height;
  267. this.domElement.width = Math.floor( width * this._pixelRatio );
  268. this.domElement.height = Math.floor( height * this._pixelRatio );
  269. if ( updateStyle === true ) {
  270. this.domElement.style.width = width + 'px';
  271. this.domElement.style.height = height + 'px';
  272. }
  273. this.setViewport( 0, 0, width, height );
  274. if ( this._initialized ) this.backend.updateSize();
  275. }
  276. setOpaqueSort( method ) {
  277. this._opaqueSort = method;
  278. }
  279. setTransparentSort( method ) {
  280. this._transparentSort = method;
  281. }
  282. getScissor( target ) {
  283. const scissor = this._scissor;
  284. target.x = scissor.x;
  285. target.y = scissor.y;
  286. target.width = scissor.width;
  287. target.height = scissor.height;
  288. return target;
  289. }
  290. setScissor( x, y, width, height ) {
  291. const scissor = this._scissor;
  292. if ( x.isVector4 ) {
  293. scissor.copy( x );
  294. } else {
  295. scissor.set( x, y, width, height );
  296. }
  297. }
  298. getScissorTest() {
  299. return this._scissorTest;
  300. }
  301. setScissorTest( boolean ) {
  302. this._scissorTest = boolean;
  303. }
  304. getViewport( target ) {
  305. return target.copy( this._viewport );
  306. }
  307. setViewport( x, y, width, height, minDepth = 0, maxDepth = 1 ) {
  308. const viewport = this._viewport;
  309. if ( x.isVector4 ) {
  310. viewport.copy( x );
  311. } else {
  312. viewport.set( x, y, width, height );
  313. }
  314. viewport.minDepth = minDepth;
  315. viewport.maxDepth = maxDepth;
  316. }
  317. getClearColor( target ) {
  318. return target.copy( this._clearColor );
  319. }
  320. setClearColor( color, alpha = 1 ) {
  321. this._clearColor.set( color );
  322. this._clearAlpha = alpha;
  323. }
  324. getClearAlpha() {
  325. return this._clearAlpha;
  326. }
  327. setClearAlpha( alpha ) {
  328. this._clearAlpha = alpha;
  329. }
  330. getClearDepth() {
  331. return this._clearDepth;
  332. }
  333. setClearDepth( depth ) {
  334. this._clearDepth = depth;
  335. }
  336. getClearStencil() {
  337. return this._clearStencil;
  338. }
  339. setClearStencil( stencil ) {
  340. this._clearStencil = stencil;
  341. }
  342. isOccluded( object ) {
  343. const renderContext = this._currentRenderContext || this._lastRenderContext;
  344. return renderContext && this.backend.isOccluded( renderContext, object );
  345. }
  346. clear( color = true, depth = true, stencil = true ) {
  347. const renderContext = this._currentRenderContext || this._lastRenderContext;
  348. if ( renderContext ) this.backend.clear( renderContext, color, depth, stencil );
  349. }
  350. clearColor() {
  351. this.clear( true, false, false );
  352. }
  353. clearDepth() {
  354. this.clear( false, true, false );
  355. }
  356. clearStencil() {
  357. this.clear( false, false, true );
  358. }
  359. dispose() {
  360. this.info.dispose();
  361. this._objects.dispose();
  362. this._properties.dispose();
  363. this._pipelines.dispose();
  364. this._nodes.dispose();
  365. this._bindings.dispose();
  366. this._renderLists.dispose();
  367. this._renderContexts.dispose();
  368. this._textures.dispose();
  369. this.setRenderTarget( null );
  370. this.setAnimationLoop( null );
  371. }
  372. setRenderTarget( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {
  373. this._renderTarget = renderTarget;
  374. this._activeCubeFace = activeCubeFace;
  375. this._activeMipmapLevel = activeMipmapLevel;
  376. }
  377. getRenderTarget() {
  378. return this._renderTarget;
  379. }
  380. async compute( computeNodes ) {
  381. if ( this._initialized === false ) await this.init();
  382. const backend = this.backend;
  383. const pipelines = this._pipelines;
  384. const bindings = this._bindings;
  385. const nodes = this._nodes;
  386. const computeList = Array.isArray( computeNodes ) ? computeNodes : [ computeNodes ];
  387. backend.beginCompute( computeNodes );
  388. for ( const computeNode of computeList ) {
  389. // onInit
  390. if ( pipelines.has( computeNode ) === false ) {
  391. const dispose = () => {
  392. computeNode.removeEventListener( 'dispose', dispose );
  393. pipelines.delete( computeNode );
  394. bindings.delete( computeNode );
  395. nodes.delete( computeNode );
  396. };
  397. computeNode.addEventListener( 'dispose', dispose );
  398. //
  399. computeNode.onInit( { renderer: this } );
  400. }
  401. nodes.updateForCompute( computeNode );
  402. bindings.updateForCompute( computeNode );
  403. const computeBindings = bindings.getForCompute( computeNode );
  404. const computePipeline = pipelines.getForCompute( computeNode, computeBindings );
  405. backend.compute( computeNodes, computeNode, computeBindings, computePipeline );
  406. }
  407. backend.finishCompute( computeNodes );
  408. }
  409. hasFeature( name ) {
  410. return this.backend.hasFeature( name );
  411. }
  412. copyFramebufferToTexture( framebufferTexture ) {
  413. const renderContext = this._currentRenderContext || this._lastRenderContext;
  414. this._textures.updateTexture( framebufferTexture );
  415. this.backend.copyFramebufferToTexture( framebufferTexture, renderContext );
  416. }
  417. readRenderTargetPixelsAsync( renderTarget, x, y, width, height ) {
  418. return this.backend.copyTextureToBuffer( renderTarget.texture, x, y, width, height );
  419. }
  420. _projectObject( object, camera, groupOrder, renderList ) {
  421. if ( object.visible === false ) return;
  422. const visible = object.layers.test( camera.layers );
  423. if ( visible ) {
  424. if ( object.isGroup ) {
  425. groupOrder = object.renderOrder;
  426. } else if ( object.isLOD ) {
  427. if ( object.autoUpdate === true ) object.update( camera );
  428. } else if ( object.isLight ) {
  429. renderList.pushLight( object );
  430. } else if ( object.isSprite ) {
  431. if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {
  432. if ( this.sortObjects === true ) {
  433. _vector3.setFromMatrixPosition( object.matrixWorld ).applyMatrix4( _projScreenMatrix );
  434. }
  435. const geometry = object.geometry;
  436. const material = object.material;
  437. if ( material.visible ) {
  438. renderList.push( object, geometry, material, groupOrder, _vector3.z, null );
  439. }
  440. }
  441. } else if ( object.isLineLoop ) {
  442. console.error( 'THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.' );
  443. } else if ( object.isMesh || object.isLine || object.isPoints ) {
  444. if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
  445. const geometry = object.geometry;
  446. const material = object.material;
  447. if ( this.sortObjects === true ) {
  448. if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
  449. _vector3
  450. .copy( geometry.boundingSphere.center )
  451. .applyMatrix4( object.matrixWorld )
  452. .applyMatrix4( _projScreenMatrix );
  453. }
  454. if ( Array.isArray( material ) ) {
  455. const groups = geometry.groups;
  456. for ( let i = 0, l = groups.length; i < l; i ++ ) {
  457. const group = groups[ i ];
  458. const groupMaterial = material[ group.materialIndex ];
  459. if ( groupMaterial && groupMaterial.visible ) {
  460. renderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group );
  461. }
  462. }
  463. } else if ( material.visible ) {
  464. renderList.push( object, geometry, material, groupOrder, _vector3.z, null );
  465. }
  466. }
  467. }
  468. }
  469. const children = object.children;
  470. for ( let i = 0, l = children.length; i < l; i ++ ) {
  471. this._projectObject( children[ i ], camera, groupOrder, renderList );
  472. }
  473. }
  474. _renderObjects( renderList, camera, scene, lightsNode ) {
  475. // process renderable objects
  476. for ( let i = 0, il = renderList.length; i < il; i ++ ) {
  477. const renderItem = renderList[ i ];
  478. // @TODO: Add support for multiple materials per object. This will require to extract
  479. // the material from the renderItem object and pass it with its group data to _renderObject().
  480. const { object, geometry, material, group } = renderItem;
  481. if ( camera.isArrayCamera ) {
  482. const cameras = camera.cameras;
  483. for ( let j = 0, jl = cameras.length; j < jl; j ++ ) {
  484. const camera2 = cameras[ j ];
  485. if ( object.layers.test( camera2.layers ) ) {
  486. const vp = camera2.viewport;
  487. const minDepth = ( vp.minDepth === undefined ) ? 0 : vp.minDepth;
  488. const maxDepth = ( vp.maxDepth === undefined ) ? 1 : vp.maxDepth;
  489. const viewportValue = this._currentRenderContext.viewportValue;
  490. viewportValue.copy( vp ).multiplyScalar( this._pixelRatio ).floor();
  491. viewportValue.minDepth = minDepth;
  492. viewportValue.maxDepth = maxDepth;
  493. this.backend.updateViewport( this._currentRenderContext );
  494. this._renderObject( object, scene, camera2, geometry, material, group, lightsNode );
  495. }
  496. }
  497. } else {
  498. this._renderObject( object, scene, camera, geometry, material, group, lightsNode );
  499. }
  500. }
  501. }
  502. _renderObject( object, scene, camera, geometry, material, group, lightsNode ) {
  503. material = scene.overrideMaterial !== null ? scene.overrideMaterial : material;
  504. //
  505. object.onBeforeRender( this, scene, camera, geometry, material, group );
  506. material.onBeforeRender( this, scene, camera, geometry, material, group );
  507. //
  508. if ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {
  509. material.side = BackSide;
  510. this._renderObjectDirect( object, material, scene, camera, lightsNode, 'backSide' ); // create backSide pass id
  511. material.side = FrontSide;
  512. this._renderObjectDirect( object, material, scene, camera, lightsNode ); // use default pass id
  513. material.side = DoubleSide;
  514. } else {
  515. this._renderObjectDirect( object, material, scene, camera, lightsNode );
  516. }
  517. //
  518. object.onAfterRender( this, scene, camera, geometry, material, group );
  519. }
  520. _renderObjectDirect( object, material, scene, camera, lightsNode, passId ) {
  521. const renderObject = this._objects.get( object, material, scene, camera, lightsNode, this._currentRenderContext, passId );
  522. //
  523. this._nodes.updateBefore( renderObject );
  524. //
  525. object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
  526. object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
  527. //
  528. this._nodes.updateForRender( renderObject );
  529. this._geometries.updateForRender( renderObject );
  530. this._bindings.updateForRender( renderObject );
  531. this._pipelines.updateForRender( renderObject );
  532. //
  533. this.backend.draw( renderObject, this.info );
  534. }
  535. }
  536. export default Renderer;