Bliss-Shader/shaders/shadow.fsh

32 lines
1010 B
Plaintext
Raw Normal View History

2023-01-13 04:00:14 +08:00
#version 120
#extension GL_ARB_shader_texture_lod : enable
#extension GL_EXT_gpu_shader4 : enable
2023-01-13 04:28:19 +08:00
#include "lib/settings.glsl"
2023-01-13 04:00:14 +08: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-13 04:28:19 +08:00
2023-01-13 04:00:14 +08:00
float R2_dither(){
vec2 alpha = vec2(0.75487765, 0.56984026);
return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 ) ;
}
void main() {
gl_FragData[0] = texture2D(tex,texcoord.xy);
2023-01-13 04:00:14 +08:00
#ifdef SHADOW_DISABLE_ALPHA_MIPMAPS
gl_FragData[0].a = texture2DLod(tex,texcoord.xy,0).a;
#endif
2023-01-13 04:00:14 +08:00
#ifdef Stochastic_Transparent_Shadows
gl_FragData[0].a = float(gl_FragData[0].a >= R2_dither());
#endif
}