using proper normals during the SSAO pass
parent
39d2bb68f8
commit
37ffc2da1e
|
@ -21,10 +21,12 @@ out vec4 ioFragPosLightSpace;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
ioFragPosition = (uViewMatrix * uModelMatrix * inCoord).xyz;
|
ioFragPosition = (uViewMatrix * uModelMatrix * inCoord).xyz;
|
||||||
ioFragNormal = transpose(inverse(mat3(uModelMatrix))) * inNormal;
|
|
||||||
|
mat4 model_view_matrix = uViewMatrix * uModelMatrix;
|
||||||
|
ioFragNormal = transpose(inverse(mat3(model_view_matrix))) * inNormal;
|
||||||
ioFragTexCoords = inUV;
|
ioFragTexCoords = inUV;
|
||||||
ioFragColor = inColor;
|
ioFragColor = inColor;
|
||||||
ioFragPosLightSpace = uLightSpaceMatrix * uModelMatrix * inCoord;
|
ioFragPosLightSpace = uLightSpaceMatrix * uModelMatrix * inCoord;
|
||||||
|
|
||||||
gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * inCoord;
|
gl_Position = uProjectionMatrix * model_view_matrix * inCoord;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue