From b6f25771747ac5adf381ff56d84b3b8fc20ec228 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 21 May 2020 15:18:00 +0100 Subject: [PATCH] Update HLSL skeletalanimation shaders with latest changes --- data/hlsl/README.md | 2 +- data/hlsl/skeletalanimation/mesh.frag | 2 +- data/hlsl/skeletalanimation/mesh.vert | 2 +- data/hlsl/skeletalanimation/texture.vert | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/hlsl/README.md b/data/hlsl/README.md index 00e274bd..208553bc 100644 --- a/data/hlsl/README.md +++ b/data/hlsl/README.md @@ -66,7 +66,7 @@ Shaders written to mirror the GLSL versions at `eddd724`. There have been change | shadowmapping | ☑ | ☑ | ☑ | ☑ | shadowmappingcascade | ☑ | ☑ | ☑ | ☑ | shadowmappingomni | ☑ | ☑ | ☑ | ☑ -| skeletalanimation | ☑ | ☑ | ☑ | ❌ +| skeletalanimation | ☑ | ☑ | ☑ | ☑ | specializationconstants | ☑ | ☑ | ☑ | ☑ | sphericalenvmapping | ☑ | ☑ | ☑ | ☑ | ssao | ☑ | ☑ | ☑ | ☑ diff --git a/data/hlsl/skeletalanimation/mesh.frag b/data/hlsl/skeletalanimation/mesh.frag index 4f207e51..4117babb 100644 --- a/data/hlsl/skeletalanimation/mesh.frag +++ b/data/hlsl/skeletalanimation/mesh.frag @@ -20,7 +20,7 @@ float4 main(VSOutput input) : SV_TARGET float3 L = normalize(input.LightVec); float3 V = normalize(input.ViewVec); float3 R = reflect(-L, N); - float3 diffuse = max(dot(N, L), 0.0) * float3(1.0, 1.0, 1.0);// * input.Color; + float3 diffuse = max(dot(N, L), 0.1) * float3(1.0, 1.0, 1.0) * input.Color; float3 specular = pow(max(dot(R, V), 0.0), 32.0) * float3(0.5, 0.5, 0.5); return float4(diffuse * color.rgb + specular, 1.0); } \ No newline at end of file diff --git a/data/hlsl/skeletalanimation/mesh.vert b/data/hlsl/skeletalanimation/mesh.vert index eff95d72..1a1d6b57 100644 --- a/data/hlsl/skeletalanimation/mesh.vert +++ b/data/hlsl/skeletalanimation/mesh.vert @@ -48,7 +48,7 @@ VSOutput main(VSInput input) output.Pos = mul(ubo.projection, mul(ubo.view, mul(ubo.model, mul(boneTransform, float4(input.Pos.xyz, 1.0))))); float4 pos = mul(ubo.model, float4(input.Pos, 1.0)); - output.Normal = mul((float3x3)mul(ubo.model, boneTransform), input.Normal); + output.Normal = mul((float3x3)(boneTransform), input.Normal); output.LightVec = ubo.lightPos.xyz - pos.xyz; output.ViewVec = ubo.viewPos.xyz - pos.xyz; return output; diff --git a/data/hlsl/skeletalanimation/texture.vert b/data/hlsl/skeletalanimation/texture.vert index 25656b7d..1b22deb6 100644 --- a/data/hlsl/skeletalanimation/texture.vert +++ b/data/hlsl/skeletalanimation/texture.vert @@ -10,8 +10,8 @@ struct VSInput struct UBO { float4x4 projection; - float4x4 model; float4x4 view; + float4x4 model; float4 lightPos; float4 viewPos; float2 uvOffset; @@ -35,7 +35,7 @@ VSOutput main(VSInput input) float4 pos = float4(input.Pos, 1.0); output.Pos = mul(ubo.projection, mul(ubo.view, mul(ubo.model, pos))); - output.Normal = mul((float3x3)ubo.model, input.Normal); + output.Normal = input.Normal; output.LightVec = ubo.lightPos.xyz - pos.xyz; output.ViewVec = ubo.viewPos.xyz - pos.xyz; return output;