minor update - light ui tweak

This commit is contained in:
2025-01-23 20:55:55 +01:00
parent c355509870
commit d8851cc679
12 changed files with 66 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ cbuffer SunLightBuffer
float4 ambientColor;
float4 diffuseColor;
float3 lightDirection;
float intensity;
};
cbuffer SunLightColorBuffer
@@ -24,6 +25,7 @@ struct PixelInputType
float2 tex : TEXCOORD0;
float3 normal : NORMAL;
float3 lightDir : TEXCOORD1;
float intensity : TEXCOORD2;
};
////////////////////////////////////////////////////////////////////////////////
@@ -42,7 +44,7 @@ float4 SunLightPixelShader(PixelInputType input) : SV_TARGET
textureColor = shaderTexture.Sample(SampleType, input.tex);
// Calculate the different amounts of light on this pixel based on the direction of the light.
lightIntensity = saturate(dot(input.normal, input.lightDir));
lightIntensity = saturate(dot(input.normal, input.lightDir)) * input.intensity;
// Determine the diffuse color amount of the light.
colorArray = diffuseColor * lightIntensity;