Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer: Move quad out of module scope. #28800

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const _screen = new Vector4();
const _frustum = new Frustum();
const _projScreenMatrix = new Matrix4();
const _vector3 = new Vector3();
const _quad = new QuadMesh( new NodeMaterial() );

class Renderer {

Expand Down Expand Up @@ -99,6 +98,8 @@ class Renderer {
this._textures = null;
this._background = null;

this._quad = new QuadMesh( new NodeMaterial() );

this._currentRenderContext = null;

this._opaqueSort = null;
Expand Down Expand Up @@ -679,14 +680,16 @@ class Renderer {

this.setRenderTarget( outputRenderTarget, activeCubeFace, activeMipmapLevel );

const quad = this._quad;

if ( this._nodes.hasOutputChange( renderTarget.texture ) ) {

_quad.material.fragmentNode = this._nodes.getOutputNode( renderTarget.texture );
_quad.material.needsUpdate = true;
quad.material.fragmentNode = this._nodes.getOutputNode( renderTarget.texture );
quad.material.needsUpdate = true;

}

this._renderScene( _quad, _quad.camera, false );
this._renderScene( quad, quad.camera, false );

}

Expand Down Expand Up @@ -967,14 +970,16 @@ class Renderer {
// If a color space transform or tone mapping is required,
// the clear operation clears the intermediate renderTarget texture, but does not update the screen canvas.

const quad = this._quad;

if ( this._nodes.hasOutputChange( renderTarget.texture ) ) {

_quad.material.fragmentNode = this._nodes.getOutputNode( renderTarget.texture );
_quad.material.needsUpdate = true;
quad.material.fragmentNode = this._nodes.getOutputNode( renderTarget.texture );
quad.material.needsUpdate = true;

}

this._renderScene( _quad, _quad.camera, false );
this._renderScene( quad, quad.camera, false );

}

Expand Down