Skip to content

Commit 336749f

Browse files
committed
fix: premultiply alpha w diffuse
1 parent ad94e1f commit 336749f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shader/input.cginc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void ParseInputs(inout v2f i, in bool isFrontFace)
4141
_Metallic = orm.b * _MetallicStrength;
4242

4343
float4 nm = TEX2D_SAMPLE_SAMPLER(_NormalMap, sampler_samplerDefault, i.uv0);
44-
_Normal = lerp(float4(0.5, 0.5, 1, 1), ReconstructNormal(nm, _NormalStrength), _NormalStrength);
44+
_Normal = ReconstructNormal(nm, _NormalStrength);
4545

4646
float alpha = 1.0;
4747
if (_pm_nk_hasalpha)
@@ -56,7 +56,7 @@ void ParseInputs(inout v2f i, in bool isFrontFace)
5656
#endif
5757

5858
float3 albedo = TEX2D_SAMPLE_SAMPLER(_DiffuseAlpha, sampler_samplerDefault, i.uv0).rgb;
59-
_Albedo = albedo * _DiffuseHDR.rgb;
59+
_Albedo = (albedo * _DiffuseHDR.rgb) * _DiffuseHDR.a;
6060

6161
float3 emission = TEX2D_SAMPLE_SAMPLER(_EmissionMask, sampler_samplerDefault, i.uv0).rgb;
6262
_Emission = emission;

0 commit comments

Comments
 (0)