Files
Bliss-Shader/shaders/dimensions/deferred2.fsh

36 lines
1.1 KiB
Plaintext
Raw Normal View History

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
uniform sampler2D depthtex0;
uniform sampler2D dhDepthTex;
2025-03-21 21:50:36 -04:00
uniform sampler2D colortex1;
uniform sampler2D colortex2;
2023-01-12 15:00:14 -05:00
uniform vec2 texelSize;
2023-01-12 15:00:14 -05:00
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
2025-03-21 21:50:36 -04:00
#if defined OVERWORLD_SHADER
/* RENDERTARGETS:1,2 */
#endif
2023-01-12 15:00:14 -05:00
void main() {
2025-03-21 21:50:36 -04:00
vec2 texcoord = gl_FragCoord.xy * texelSize;
2025-03-21 21:50:36 -04:00
gl_FragData[0] = texelFetch2D(colortex1, ivec2(gl_FragCoord.xy),0);
2025-03-21 21:50:36 -04:00
if(texelFetch2D(depthtex0, ivec2(gl_FragCoord.xy), 0).x < 1.0 || texelFetch2D(dhDepthTex, ivec2(gl_FragCoord.xy), 0).x < 1.0) {
// doing this for precision reasons, DH does NOT like depth => 1.0
}else{
2025-03-21 21:50:36 -04:00
gl_FragData[0].rgb = texelFetch2D(colortex2, ivec2(gl_FragCoord.xy),0).rgb * 10.0;
gl_FragData[0].a = 0.0;
2025-03-21 21:50:36 -04:00
}
2023-01-12 15:00:14 -05:00
2025-03-21 21:50:36 -04:00
gl_FragData[1] = vec4(0,0,0,0);
2023-01-12 15:00:14 -05:00
2023-10-07 22:18:20 -04:00
}