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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default /* glsl */`

// Doing a strict comparison with == 1.0 can cause noise artifacts
// on some platforms. See issue #17623.
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;

#endif
`;
1 change: 0 additions & 1 deletion src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
'#define varying in',
( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;',
( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor',
'#define gl_FragDepthEXT gl_FragDepth',
'#define texture2D texture',
'#define textureCube texture',
'#define texture2DProj textureProj',
Expand Down
5 changes: 2 additions & 3 deletions src/renderers/webxr/WebXRDepthSensing.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ void main() {

if ( coord.x >= 1.0 ) {

gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

} else {

gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

}

Expand Down Expand Up @@ -73,7 +73,6 @@ class WebXRDepthSensing {

const viewport = cameraXR.cameras[ 0 ].viewport;
const material = new ShaderMaterial( {
extensions: { fragDepth: true },
vertexShader: _occlusion_vertex,
fragmentShader: _occlusion_fragment,
uniforms: {
Expand Down