diff options
Diffstat (limited to 'drivers/gles3/shaders/scene.glsl')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index f94ca6fcba..247d1468c3 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -429,7 +429,9 @@ vec3 textureDualParaboloid(sampler2DArray p_tex, vec3 p_vec,float p_roughness) { // we need to lie the derivatives (normg) and assume that DP side is always the same // to get proper texure filtering vec2 normg=norm.xy; - norm.y+=max(0.0,sign(norm.z))*0.5; + if (norm.z>0) { + norm.y=0.5-norm.y+0.5; + } // thanks to OpenGL spec using floor(layer + 0.5) for texture arrays, // it's easy to have precision errors using fract() to interpolate layers @@ -451,7 +453,9 @@ vec3 textureDualParaboloid(sampler2D p_tex, vec3 p_vec,float p_roughness) { vec3 norm = normalize(p_vec); norm.xy/=1.0+abs(norm.z); norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25); - norm.y+=max(0.0,sign(norm.z))*0.5; + if (norm.z>0) { + norm.y=0.5-norm.y+0.5; + } return textureLod(p_tex, norm.xy, p_roughness * RADIANCE_MAX_LOD).xyz; } |