Slightly reworked glTF samples

Parent matrices are now applied (where available)
Now more in line with the base code glTF loader
Refs #964
This commit is contained in:
Sascha Willems 2022-08-06 10:16:54 +02:00
parent 465c18862c
commit f084d6093c
11 changed files with 71 additions and 50 deletions

View file

@ -10,6 +10,7 @@ layout (set = 0, binding = 0) uniform UBOScene
mat4 projection;
mat4 view;
vec4 lightPos;
vec4 viewPos;
} uboScene;
layout(push_constant) uniform PushConsts {
@ -32,6 +33,6 @@ void main()
vec4 pos = uboScene.view * vec4(inPos, 1.0);
outNormal = mat3(uboScene.view) * inNormal;
vec3 lPos = mat3(uboScene.view) * uboScene.lightPos.xyz;
outLightVec = lPos - pos.xyz;
outViewVec = -pos.xyz;
outLightVec = uboScene.lightPos.xyz - pos.xyz;
outViewVec = uboScene.viewPos.xyz - pos.xyz;
}