openmw/files/shaders/lib/particle/occlusion.glsl

16 lines
268 B
Text
Raw Permalink Normal View History

2023-02-25 11:03:39 -08:00
#ifndef LIB_PARTICLE_OCCLUSION
#define LIB_PARTICLE_OCCLUSION
void applyOcclusionDiscard(in vec3 coord, float sceneDepth)
{
#if @reverseZ
if (coord.z < sceneDepth)
discard;
#else
if (coord.z * 0.5 + 0.5 > sceneDepth)
discard;
#endif
}
#endif