38 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-01-12 15:00:14 -05:00
#version 120
2023-10-08 15:16:13 -04:00
2023-07-07 13:56:38 +01:00
#include "/lib/settings.glsl"
2023-01-12 15:28:19 -05:00
varying vec4 color;
2023-01-12 15:28:19 -05:00
2023-01-12 15:00:14 -05:00
varying vec2 texcoord;
uniform sampler2D tex;
uniform sampler2D noisetex;
2024-03-20 21:44:25 -04:00
2023-01-12 15:00:14 -05:00
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
2023-01-12 15:28:19 -05:00
float blueNoise(){
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 );
2023-01-12 15:00:14 -05:00
}
2024-03-20 21:44:25 -04:00
2023-01-12 15:00:14 -05:00
void main() {
2024-11-15 17:54:18 -05:00
vec4 shadowColor = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
#ifdef TRANSLUCENT_COLORED_SHADOWS
if(shadowColor.a > 0.9999) shadowColor.rgb = vec3(0.0);
#endif
gl_FragData[0] = shadowColor;
// gl_FragData[0] = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
#ifdef Stochastic_Transparent_Shadows
if(gl_FragData[0].a < blueNoise()) { discard; return;}
#endif
2023-01-12 15:00:14 -05:00
}