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 17, 2024
1 parent abce0ba commit 2ccf2f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ class Renderer {

this._compilationPromises = null;

// backwards compatibility
this.transparent = true;
this.opaque = true;

this.shadowMap = {
enabled: false,
Expand Down Expand Up @@ -317,8 +318,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 @@ -679,8 +680,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 2ccf2f3

Please sign in to comment.