From d52654dfdbe16345023fed4c61261dc4c66b96fe Mon Sep 17 00:00:00 2001 From: Omniscient Date: Sat, 15 Jun 2024 22:20:15 +1000 Subject: trying to figure out uniform structs.. --- assets/shaders/pbr_params.vert | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'assets/shaders/pbr_params.vert') diff --git a/assets/shaders/pbr_params.vert b/assets/shaders/pbr_params.vert index e3cbe96..01379d7 100644 --- a/assets/shaders/pbr_params.vert +++ b/assets/shaders/pbr_params.vert @@ -19,7 +19,8 @@ layout(location = 2) out vec2 fragTexCoords; void main() { fragWorldPos = vec3(mvp.model * vec4(inPosition, 1.0)); - // TODO: fragNormal + mat3 normalMatrix = transpose(inverse(mat3(mvp.model))); + fragNormal = normalMatrix * inNormal; fragTexCoords = inTexCoords; gl_Position = mvp.proj * mvp.view * mvp.model * vec4(inPosition, 1.0); -- cgit v1.2.3-70-g09d2