move inside if
This commit is contained in:
@@ -64,21 +64,23 @@ void main() {
|
||||
bool hasAO = (metadata>>6)!=0;
|
||||
vec3 pos = rev3d(vec3(point, depth));
|
||||
|
||||
|
||||
ocolour = colour;
|
||||
ocolour.w = 1.0f;
|
||||
|
||||
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));
|
||||
|
||||
float d = 0.0;
|
||||
if (hasAO) {
|
||||
d = computeAOAngle(pos, 1.0*(1<<lod), viewNormal);//1
|
||||
if (d<0.1) {
|
||||
d = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
ocolour = colour;
|
||||
ocolour.xyz *= ((1.0f-d)/3.0f+(2.0f/3.0f));
|
||||
ocolour.w = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
imageStore(colourTexOut, ivec2(gl_GlobalInvocationID.xy), ocolour);
|
||||
|
||||
Reference in New Issue
Block a user