Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/webgpu_postprocessing_godrays.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

scene.add( new THREE.AmbientLight( 0xcccccc, 0.4 ) );

const pointLight = new THREE.PointLight( 0xffffff, 10000 );
const pointLight = new THREE.PointLight( 0xf6287d, 10000 );
pointLight.castShadow = true;
pointLight.shadow.bias = - 0.00001;
pointLight.shadow.mapSize.width = 2048;
Expand Down
32 changes: 30 additions & 2 deletions src/renderers/webgl-fallback/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,12 @@ class WebGLBackend extends Backend {

if ( renderContext.scissor ) {

const { x, y, width, height } = renderContext.scissorValue;
this.updateScissor( renderContext );

state.scissor( x, renderContext.height - height - y, width, height );
} else {

const { width, height } = this.getDrawingBufferSize();
state.scissor( 0, 0, width, height );

}

Expand Down Expand Up @@ -545,6 +548,17 @@ class WebGLBackend extends Backend {

}

if ( previousContext.scissor ) {

this.updateScissor( previousContext );

} else {

const { width, height } = this.getDrawingBufferSize();
state.scissor( 0, 0, width, height );

}

}

this.prepareTimestampBuffer( TimestampQuery.RENDER, this.getTimestampUID( renderContext ) );
Expand Down Expand Up @@ -646,6 +660,20 @@ class WebGLBackend extends Backend {

}

/**
* Updates the scissor with the values from the given render context.
*
* @param {RenderContext} renderContext - The render context.
*/
updateScissor( renderContext ) {

const { state } = this;
const { x, y, width, height } = renderContext.scissorValue;

state.scissor( x, renderContext.height - height - y, width, height );

}

/**
* Defines the scissor test.
*
Expand Down
Loading