Skeletalanimation fix (#671)
* Fixed anc code cleanup for skeletal animation Refs #669 * Fix android build
This commit is contained in:
parent
fcb0a2a46a
commit
d1fbf8d00a
11 changed files with 26 additions and 37 deletions
|
|
@ -1,4 +0,0 @@
|
|||
glslangvalidator -V mesh.vert -o mesh.vert.spv
|
||||
glslangvalidator -V mesh.frag -o mesh.frag.spv
|
||||
glslangvalidator -V texture.vert -o texture.vert.spv
|
||||
glslangvalidator -V texture.frag -o texture.frag.spv
|
||||
|
|
@ -18,7 +18,7 @@ void main()
|
|||
vec3 L = normalize(inLightVec);
|
||||
vec3 V = normalize(inViewVec);
|
||||
vec3 R = reflect(-L, N);
|
||||
vec3 diffuse = max(dot(N, L), 0.0) * vec3(1.0);// * inColor;
|
||||
vec3 diffuse = max(dot(N, L), 0.1) * vec3(1.0) * inColor;
|
||||
vec3 specular = pow(max(dot(R, V), 0.0), 32.0) * vec3(0.5);
|
||||
outFragColor = vec4(diffuse * color.rgb + specular, 1.0);
|
||||
}
|
||||
Binary file not shown.
|
|
@ -43,7 +43,7 @@ void main()
|
|||
gl_Position = ubo.projection * ubo.view * ubo.model * boneTransform * vec4(inPos.xyz, 1.0);
|
||||
|
||||
vec4 pos = ubo.model * vec4(inPos, 1.0);
|
||||
outNormal = mat3(inverse(transpose(ubo.model * boneTransform))) * inNormal;
|
||||
outNormal = mat3(boneTransform) * inNormal;
|
||||
outLightVec = ubo.lightPos.xyz - pos.xyz;
|
||||
outViewVec = ubo.viewPos.xyz - pos.xyz;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -7,8 +7,8 @@ layout (location = 2) in vec2 inUV;
|
|||
layout (binding = 0) uniform UBO
|
||||
{
|
||||
mat4 projection;
|
||||
mat4 model;
|
||||
mat4 view;
|
||||
mat4 model;
|
||||
vec4 lightPos;
|
||||
vec4 viewPos;
|
||||
vec2 uvOffset;
|
||||
|
|
@ -30,7 +30,7 @@ void main()
|
|||
vec4 pos = vec4(inPos, 1.0);
|
||||
gl_Position = ubo.projection * ubo.view * ubo.model * vec4(pos);
|
||||
|
||||
outNormal = mat3(ubo.model) * inNormal;
|
||||
outNormal = inNormal;
|
||||
outLightVec = ubo.lightPos.xyz - pos.xyz;
|
||||
outViewVec = ubo.viewPos.xyz - pos.xyz;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue