diff --git a/Effects/FXB/PBREffect.fxb b/Effects/FXB/PBREffect.fxb index 1cac37b..1747aa4 100644 Binary files a/Effects/FXB/PBREffect.fxb and b/Effects/FXB/PBREffect.fxb differ diff --git a/Effects/HLSL/PBREffect.fx b/Effects/HLSL/PBREffect.fx index 34ce0ec..b595bba 100644 --- a/Effects/HLSL/PBREffect.fx +++ b/Effects/HLSL/PBREffect.fx @@ -25,7 +25,7 @@ BEGIN_CONSTANTS float3 LightPositions[4] _ps(c4) _cb(c4); float3 PositionLightColors[4] _ps(c8) _cb(c8); - float3 LightDirections[4] _ps(c12) _cb(c12); + float3 LightDirections[4] _ps(c12) _cb(c12); float3 DirectionLightColors[4] _ps(c16) _cb(c16); float3 EyePosition _ps(c20) _cb(c20); @@ -57,7 +57,7 @@ struct PixelShaderInput PixelShaderInput main_vs(VertexShaderInput input) { PixelShaderInput output; - + output.TexCoord = input.TexCoord; output.PositionWS = mul(input.Position, World).xyz; output.NormalWS = mul(input.Normal, (float3x3)WorldInverseTranspose).xyz; @@ -155,14 +155,14 @@ float3 ComputeLight( } float4 ComputeColor( - float3 worldPosition, - float3 worldNormal, - float3 albedo, - float metallic, + float3 worldPosition, + float3 worldNormal, + float3 albedo, + float metallic, float roughness ) { float3 V = normalize(EyePosition - worldPosition); - float3 N = worldNormal; + float3 N = normalize(worldNormal); float3 F0 = float3(0.04, 0.04, 0.04); F0 = lerp(F0, albedo, metallic); @@ -204,7 +204,7 @@ float4 None(PixelShaderInput input) : SV_TARGET0 { return ComputeColor( input.PositionWS, - input.NormalWS, + input.NormalWS, AlbedoValue, MetallicValue, RoughnessValue