Add missing inverseModelView UBO to fix hdr sample

This commit is contained in:
Ben Clayton 2020-05-21 14:39:30 +01:00
parent b6f2577174
commit 13c081664e
10 changed files with 40 additions and 35 deletions

View file

@ -8,6 +8,7 @@ layout (constant_id = 0) const int type = 0;
layout (binding = 0) uniform UBO {
mat4 projection;
mat4 modelview;
mat4 inverseModelview;
} ubo;
layout (location = 0) out vec3 outUVW;
@ -15,14 +16,13 @@ layout (location = 1) out vec3 outPos;
layout (location = 2) out vec3 outNormal;
layout (location = 3) out vec3 outViewVec;
layout (location = 4) out vec3 outLightVec;
layout (location = 5) out mat4 outInvModelView;
out gl_PerVertex
out gl_PerVertex
{
vec4 gl_Position;
};
void main()
void main()
{
outUVW = inPos;
@ -37,11 +37,9 @@ void main()
break;
}
outPos = vec3(ubo.modelview * vec4(inPos, 1.0));
outNormal = mat3(ubo.modelview) * inNormal;
outInvModelView = inverse(ubo.modelview);
outNormal = mat3(ubo.modelview) * inNormal;
vec3 lightPos = vec3(0.0f, -5.0f, 5.0f);
outLightVec = lightPos.xyz - outPos.xyz;
outViewVec = -outPos.xyz;
outViewVec = -outPos.xyz;
}