diff options
Diffstat (limited to 'drivers/gles3/shaders/scene.glsl')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 340a1f24d2..3f0498746b 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1523,6 +1523,10 @@ void main() { #endif +#if defined(ALPHA_SCISSOR_USED) + float alpha_scissor = 0.5; +#endif + #if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) vec3 binormal = normalize(binormal_interp)*side; vec3 tangent = normalize(tangent_interp)*side; @@ -1571,6 +1575,12 @@ FRAGMENT_SHADER_CODE } +#if defined(ALPHA_SCISSOR_USED) + if (alpha<alpha_scissor) { + discard; + } +#endif + #if defined(ENABLE_NORMALMAP) @@ -1929,7 +1939,7 @@ FRAGMENT_SHADER_CODE if (fog_depth_enabled) { - float fog_z = smoothstep(fog_depth_begin,z_far,-vertex.z); + float fog_z = smoothstep(fog_depth_begin,z_far,length(vertex)); fog_amount = pow(fog_z,fog_depth_curve); if (fog_transmit_enabled) { |