Renderer.js 20 KB

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