Skip to content

Commit

Permalink
wip shadow working
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Sep 22, 2023
1 parent 81a6080 commit 632aed2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
10 changes: 2 additions & 8 deletions examples/jsm/nodes/lighting/AnalyticLightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,8 @@ class AnalyticLightNode extends LightingNode {

shadowCoord = vec3(
shadowCoord.x,
shadowCoord.y.oneMinus(), // WebGPU: Flip Y
shadowCoord.z.add( bias ).mul( 2 ).sub( 1 ) // WebGPU: Convertion [ 0, 1 ] to [ - 1, 1 ]
);

shadowCoord = vec3(
shadowCoord.x,
shadowCoord.y.oneMinus(), // WebGPU: Flip Y
shadowCoord.z//.add( bias ) // .mul( 2 ).sub( 1 ) // WebGPU: Convertion [ 0, 1 ] to [ - 1, 1 ]
shadowCoord.y,//.oneMinus(), // WebGPU: Flip Y
shadowCoord.z.add( bias ) // .mul( 2 ).sub( 1 ) // WebGPU: Convertion [ 0, 1 ] to [ - 1, 1 ]
);

const textureCompare = ( depthTexture, shadowCoord, compare ) => texture( depthTexture, shadowCoord ).compare( compare );
Expand Down
11 changes: 0 additions & 11 deletions examples/jsm/renderers/webgl/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,17 +891,6 @@ if ( error < 100 ) { console.log( this.get( texture ), texture ); error++ }

gl.bindFramebuffer( gl.DRAW_FRAMEBUFFER, fb );

/*
if ( renderContext.depthTexture !== null ) {
//console.log( 'rebind');
const { textureGPU } = this.get( renderContext.depthTexture );
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, textureGPU, 0 );
}
*/
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_cubemap_dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
//

material = new Nodes.MeshStandardNodeMaterial( {
envMap: cubeRenderTarget.texture,
// envMap: cubeRenderTarget.texture,
roughness: 0.05,
metalness: 1
} );
Expand Down

0 comments on commit 632aed2

Please sign in to comment.