mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2026-10-10 05:03:04 +08:00
fix oopsie compile error
This commit is contained in:
@@ -166,37 +166,39 @@ void doCameraGridLines(inout vec3 color, in vec2 texcoord){
|
||||
color = mix(color, vec3(1.0), gridLines);
|
||||
}
|
||||
|
||||
void doColorKeying(inout vec3 color){
|
||||
// get distance from the camera in meters
|
||||
#ifdef USING_LOD_MOD
|
||||
float linearDistance = length(mat3(gbufferModelViewInverse)*toScreenSpace_DH(gl_FragCoord.xy*texelSize, texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r, texelFetch(LOD_DEPTHTEX0,ivec2(gl_FragCoord.xy),0).r));
|
||||
#else
|
||||
float linearDistance = length(mat3(gbufferModelViewInverse)*toScreenSpace(vec3(gl_FragCoord.xy*texelSize, texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r)));
|
||||
#endif
|
||||
#ifdef COLOR_KEYING
|
||||
void doColorKeying(inout vec3 color){
|
||||
// get distance from the camera in meters
|
||||
#ifdef USING_LOD_MOD
|
||||
float linearDistance = length(mat3(gbufferModelViewInverse)*toScreenSpace_DH(gl_FragCoord.xy*texelSize, texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r, texelFetch(LOD_DEPTHTEX0,ivec2(gl_FragCoord.xy),0).r));
|
||||
#else
|
||||
float linearDistance = length(mat3(gbufferModelViewInverse)*toScreenSpace(vec3(gl_FragCoord.xy*texelSize, texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r)));
|
||||
#endif
|
||||
|
||||
// set range(s)
|
||||
linearDistance = linearDistance - COLOR_KEY_RANGE;
|
||||
|
||||
// configure width n shiz
|
||||
#if COLOR_KEY_WIDTH > 0
|
||||
linearDistance /= COLOR_KEY_WIDTH*0.5;
|
||||
#ifdef COLOR_KEY_INVERT
|
||||
linearDistance = -1.0 + abs(linearDistance);
|
||||
// set range(s)
|
||||
linearDistance = linearDistance - COLOR_KEY_RANGE;
|
||||
|
||||
// configure width n shiz
|
||||
#if COLOR_KEY_WIDTH > 0
|
||||
linearDistance /= COLOR_KEY_WIDTH*0.5;
|
||||
#ifdef COLOR_KEY_INVERT
|
||||
linearDistance = -1.0 + abs(linearDistance);
|
||||
#else
|
||||
linearDistance = 1.0 - abs(linearDistance);
|
||||
#endif
|
||||
linearDistance *= COLOR_KEY_WIDTH*0.5;
|
||||
#else
|
||||
linearDistance = 1.0 - abs(linearDistance);
|
||||
#ifdef COLOR_KEY_INVERT
|
||||
linearDistance = 1.0 - linearDistance;
|
||||
#else
|
||||
linearDistance = -1.0 + linearDistance;
|
||||
#endif
|
||||
#endif
|
||||
linearDistance *= COLOR_KEY_WIDTH*0.5;
|
||||
#else
|
||||
#ifdef COLOR_KEY_INVERT
|
||||
linearDistance = 1.0 - linearDistance;
|
||||
#else
|
||||
linearDistance = -1.0 + linearDistance;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// composite
|
||||
if(linearDistance > 0.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
|
||||
}
|
||||
|
||||
// composite
|
||||
if(linearDistance > 0.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
|
||||
}
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user