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/jsm/shaders/UnpackDepthRGBAShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const UnpackDepthRGBAShader = {

float depth = unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );

#ifdef USE_REVERSEDEPTHBUF
#ifdef USE_REVERSED_DEPTH_BUFFER

gl_FragColor = vec4( vec3( depth ), opacity );

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default /* glsl */`
#if defined( USE_LOGDEPTHBUF )
#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )

// Doing a strict comparison with == 1.0 can cause noise artifacts
// on some platforms. See issue #17623.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default /* glsl */`
#if defined( USE_LOGDEPTHBUF )
#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )

uniform float logDepthBufFC;
varying float vFragDepth;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default /* glsl */`
#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGARITHMIC_DEPTH_BUFFER

varying float vFragDepth;
varying float vIsPerspective;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default /* glsl */`
#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGARITHMIC_DEPTH_BUFFER

vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default /* glsl */`

float depth = unpackRGBAToDepth( texture2D( depths, uv ) );

#ifdef USE_REVERSEDEPTHBUF
#ifdef USE_REVERSED_DEPTH_BUFFER

return step( depth, compare );

Expand All @@ -101,7 +101,7 @@ export default /* glsl */`

vec2 distribution = texture2DDistribution( shadow, uv );

#ifdef USE_REVERSEDEPTHBUF
#ifdef USE_REVERSED_DEPTH_BUFFER

float hard_shadow = step( distribution.x, compare ); // Hard Shadow

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderLib/depth.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void main() {

// Higher precision equivalent of gl_FragCoord.z

#ifdef USE_REVERSEDEPTHBUF
#ifdef USE_REVERSED_DEPTH_BUFFER

float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];

Expand Down
8 changes: 4 additions & 4 deletions src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {

parameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',

parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
parameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',
parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',

'uniform mat4 modelMatrix;',
'uniform mat4 modelViewMatrix;',
Expand Down Expand Up @@ -820,8 +820,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
parameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',

parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
parameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',
parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',

'uniform mat4 viewMatrix;',
'uniform vec3 cameraPosition;',
Expand Down
Loading