Various debug to check lighting
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,10 +27,10 @@ cbuffer RootConstants : register(b0, space0)
|
||||
float2 Translate; // 2D translation
|
||||
float2 _Padding2; // Explicit padding to align LightDirection to 16 bytes
|
||||
|
||||
float3 LightDirection; // Normalized, world-space
|
||||
float LightPad;
|
||||
float3 LightColor;
|
||||
float AmbientIntensity;
|
||||
float3 GlobalLightDirection; // Normalized, world-space
|
||||
float GlobalLightPad;
|
||||
float3 GlobalLightColor;
|
||||
float GlobalAmbientIntensity;
|
||||
|
||||
uint LightBufferIndex;
|
||||
uint ActiveLightCount;
|
||||
|
||||
@@ -12,11 +12,11 @@ float4 main(Input input) : SV_Target0
|
||||
float3 normal = normalize(input.WorldNormal);
|
||||
|
||||
// Initial ambient component
|
||||
float3 result = input.Color.rgb * LightColor * AmbientIntensity;
|
||||
float3 result = input.Color.rgb * GlobalLightColor * GlobalAmbientIntensity;
|
||||
|
||||
// Directional light contribution
|
||||
float ndotl = max(dot(normal, -LightDirection), 0.0);
|
||||
result += input.Color.rgb * LightColor * ndotl;
|
||||
float ndotl = max(dot(normal, -GlobalLightDirection), 0.0);
|
||||
result += input.Color.rgb * GlobalLightColor * ndotl;
|
||||
|
||||
// Point lights
|
||||
if (ActiveLightCount > 0)
|
||||
|
||||
Reference in New Issue
Block a user