diff --git a/ArchitectureColoredPainting/res/Shaders/ssao.comp b/ArchitectureColoredPainting/res/Shaders/ssao.comp index 54b7c80..cff2360 100644 --- a/ArchitectureColoredPainting/res/Shaders/ssao.comp +++ b/ArchitectureColoredPainting/res/Shaders/ssao.comp @@ -28,7 +28,7 @@ void main() // get input for SSAO algorithm vec3 worldPos = texelFetch(gPosition, pixelLocation, 0).xyz; vec3 fragPos = (view * vec4(worldPos, 1.0)).xyz; - vec3 normal = normalize((texelFetch(gNormal, pixelLocation, 0).xyz - vec3(0.5)) * 2); + vec3 normal = normalize(mat3(view) * ((texelFetch(gNormal, pixelLocation, 0).xyz - vec3(0.5)) * 2)); vec3 randomVec = normalize(texture(texNoise, vec2(pixelLocation) * noiseScale).xyz); // create TBN change-of-basis matrix: from tangent-space to view-space vec3 tangent = normalize(randomVec - normal * dot(randomVec, normal));