Bliss-Shader/shaders/shadow.fsh

35 lines
1017 B
Plaintext
Raw Normal View History

2023-01-12 15:00:14 -05:00
#version 120
//#extension GL_ARB_shader_texture_lod : disable
//#extension GL_EXT_gpu_shader4 : disable
2023-07-07 13:56:38 +01:00
#include "/lib/settings.glsl"
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;
uniform int frameCounter;
//////////////////////////////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
}
void main() {
gl_FragData[0] = texture2D(tex,texcoord.xy);
2023-01-12 15:00:14 -05:00
#ifdef SHADOW_DISABLE_ALPHA_MIPMAPS
gl_FragData[0].a = texture2DLod(tex,texcoord.xy,0).a;
2023-01-12 15:00:14 -05:00
#endif
2023-07-02 17:27:20 -04:00
#ifdef RENDER_ENTITY_SHADOWS
#endif
2023-01-12 15:00:14 -05:00
#ifdef Stochastic_Transparent_Shadows
gl_FragData[0].a = float(gl_FragData[0].a >= blueNoise());
2023-01-12 15:00:14 -05:00
#endif
}