move inside if

This commit is contained in:
mcrcortex
2025-05-08 16:20:42 +10:00
parent 09666e2dfa
commit 6a42bcccc7

View File

@@ -64,21 +64,23 @@ void main() {
bool hasAO = (metadata>>6)!=0; bool hasAO = (metadata>>6)!=0;
vec3 pos = rev3d(vec3(point, depth)); vec3 pos = rev3d(vec3(point, depth));
//TODO: TODO: only encode the axis, then use then it as as a mask along with pos and multiply by the -sign of everything
vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (float(int(face)&1)*2-1);
//vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (-sign(pos));
float d = 0.0; ocolour = colour;
ocolour.w = 1.0f;
if (hasAO) { if (hasAO) {
float d = 0.0;
//TODO: TODO: only encode the axis, then use then it as as a mask along with pos and multiply by the -sign of everything
vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (float(int(face)&1)*2-1);
//vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (-sign(pos));
d = computeAOAngle(pos, 1.0*(1<<lod), viewNormal);//1 d = computeAOAngle(pos, 1.0*(1<<lod), viewNormal);//1
if (d<0.1) { if (d<0.1) {
d = 0.0f; d = 0.0f;
} }
}
ocolour = colour; ocolour.xyz *= ((1.0f-d)/3.0f+(2.0f/3.0f));
ocolour.xyz *= ((1.0f-d)/3.0f+(2.0f/3.0f)); }
ocolour.w = 1.0f;
} }
} }
imageStore(colourTexOut, ivec2(gl_GlobalInvocationID.xy), ocolour); imageStore(colourTexOut, ivec2(gl_GlobalInvocationID.xy), ocolour);