Skip to content

Commit

Permalink
Introduce renderer.transparent and renderer.opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Jul 13, 2024
1 parent dda58fa commit 677d83f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ class Renderer {

// backwards compatibility

this.transparent = true;
this.opaque = true;

this.nodeHandler = null;

this.shadowMap = {
Expand Down Expand Up @@ -319,8 +322,8 @@ class Renderer {
const transparentObjects = renderList.transparent;
const lightsNode = renderList.lightsNode;

if ( opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
if ( transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );
if ( this.opaque === true && opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
if ( this.transparent === true && transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );

// restore render tree

Expand Down Expand Up @@ -681,8 +684,8 @@ class Renderer {
const lightsNode = renderList.lightsNode;

if ( bundles.length > 0 ) this._renderBundles( bundles, sceneRef, lightsNode );
if ( opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
if ( transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );
if ( this.opaque === true && opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
if ( this.transparent === true && transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );

// finish render pass

Expand Down

0 comments on commit 677d83f

Please sign in to comment.