Fix hlsl pixel shader in multisampling demo

This commit is contained in:
arufus 2022-08-11 17:26:26 +08:00
parent 0dc33496df
commit 310a9ec6f9
2 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2020 Google LLC // Copyright 2020 Google LLC
Texture2D textureColorMap : register(t1); Texture2D textureColorMap : register(t0, space1);
SamplerState samplerColorMap : register(s1); SamplerState samplerColorMap : register(s0, space1);
struct VSOutput struct VSOutput
{ {
@ -20,7 +20,7 @@ float4 main(VSOutput input) : SV_TARGET
float3 L = normalize(input.LightVec); float3 L = normalize(input.LightVec);
float3 V = normalize(input.ViewVec); float3 V = normalize(input.ViewVec);
float3 R = reflect(-L, N); float3 R = reflect(-L, N);
float3 diffuse = max(dot(N, L), 0.0) * input.Color; float3 diffuse = max(dot(N, L), 0.15) * input.Color;
float3 specular = pow(max(dot(R, V), 0.0), 16.0) * float3(0.75, 0.75, 0.75); float3 specular = pow(max(dot(R, V), 0.0), 16.0) * float3(0.75, 0.75, 0.75);
return float4(diffuse * color.rgb + specular, 1.0); return float4(diffuse * color.rgb + specular, 1.0);
} }