Split sample into header and source files due to complexity

This commit is contained in:
Sascha Willems 2020-05-15 07:13:51 +02:00
parent 940aef5b86
commit 149ff8f94e
6 changed files with 1122 additions and 1077 deletions

View file

@ -1,6 +1,6 @@
#version 450
layout (set = 1, binding = 0) uniform sampler2D samplerColorMap;
layout (set = 2, binding = 0) uniform sampler2D samplerColorMap;
layout (location = 0) in vec3 inNormal;
layout (location = 1) in vec3 inColor;

View file

@ -18,7 +18,7 @@ layout(push_constant) uniform PushConsts {
mat4 model;
} primitive;
layout(std430, set = 2, binding = 0) readonly buffer JointMatrices {
layout(std430, set = 1, binding = 0) readonly buffer JointMatrices {
mat4 jointMatrices[];
};
@ -43,8 +43,9 @@ void main()
gl_Position = uboScene.projection * uboScene.view * primitive.model * skinMat * vec4(inPos.xyz, 1.0);
outNormal = normalize(transpose(inverse(mat3(uboScene.view * primitive.model * skinMat))) * inNormal);
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;