SSAO sample: Render Sponza with textures

This commit is contained in:
Sascha Willems 2021-02-25 19:16:41 +01:00
parent 73e538c1b8
commit 70ec72e790
5 changed files with 29 additions and 15 deletions

View file

@ -9,7 +9,7 @@ layout (location = 0) out vec4 outPosition;
layout (location = 1) out vec4 outNormal;
layout (location = 2) out vec4 outAlbedo;
layout (binding = 0) uniform UBO
layout (set = 0, binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
@ -18,6 +18,8 @@ layout (binding = 0) uniform UBO
float farPlane;
} ubo;
layout (set = 1, binding = 0) uniform sampler2D samplerColormap;
float linearDepth(float depth)
{
float z = depth * 2.0f - 1.0f;
@ -28,5 +30,5 @@ void main()
{
outPosition = vec4(inPos, linearDepth(gl_FragCoord.z));
outNormal = vec4(normalize(inNormal) * 0.5 + 0.5, 1.0);
outAlbedo = vec4(inColor * 2.0, 1.0);
outAlbedo = texture(samplerColormap * inColor, inUV);
}