minor update - light ui tweak
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user