#ifndef MINECRAFT_OIT_GLSL #define MINECRAFT_OIT_GLSL #ifdef OIT #include #if defined(OIT_TRANSMITTANCE) || defined(OIT_ACCUMULATE) #include #endif #if defined(OIT_DEPTH_BOUNDS) #include #elif defined(OIT_TRANSMITTANCE) #include #else #include #endif #endif void executeAlphaOnlyPhase(float deviceDepth, float alpha) { #ifdef OIT_DEPTH_BOUNDS if (alpha < 0.01) { discard; } calculateDepthBounds(deviceDepth, alpha); #elif defined(OIT_ADDITIVE) // Additive surfaces do not occlude, so they contribute nothing to the transmittance function. Discard to avoid writing to those targets. discard; #elif defined(OIT_TRANSMITTANCE) addTransmittance(1.0 - alpha); #endif } #endif