diff --git a/Assets/compiled/SolidColor.frag.dxil b/Assets/compiled/SolidColor.frag.dxil index 72ba1d9..c0d695a 100644 Binary files a/Assets/compiled/SolidColor.frag.dxil and b/Assets/compiled/SolidColor.frag.dxil differ diff --git a/Assets/source/SolidColor.frag.hlsl b/Assets/source/SolidColor.frag.hlsl index e9ec3f6..a0cd73a 100644 --- a/Assets/source/SolidColor.frag.hlsl +++ b/Assets/source/SolidColor.frag.hlsl @@ -11,11 +11,13 @@ float4 main(Input input) : SV_Target0 { float3 normal = normalize(input.WorldNormal); - // Initial ambient component - float3 result = input.Color.rgb * GlobalLightColor * GlobalAmbientIntensity; + // Initial ambient component (Soft blue sky ambient) + float3 ambientColor = float3(0.6f, 0.7f, 0.9f); + float3 result = input.Color.rgb * ambientColor * GlobalAmbientIntensity; // Directional light contribution - float ndotl = max(dot(normal, -GlobalLightDirection), 0.0); + float3 sunDir = normalize(-GlobalLightDirection); + float ndotl = max(dot(normal, sunDir), 0.0); result += input.Color.rgb * GlobalLightColor * ndotl; // Point lights @@ -42,5 +44,8 @@ float4 main(Input input) : SV_Target0 } } + // Simple Gamma correction + result = pow(result, 1.0 / 2.2); + return float4(result, input.Color.a); }