From 14cdf12e17d2b17676135457e42bde391ff3f313 Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 20 Feb 2025 18:48:18 -0800 Subject: Add emission, fine-tune quantized specular --- yum_pbr.cginc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'yum_pbr.cginc') diff --git a/yum_pbr.cginc b/yum_pbr.cginc index 2f7113b..dbb8d75 100644 --- a/yum_pbr.cginc +++ b/yum_pbr.cginc @@ -9,6 +9,9 @@ struct YumPbr { float4 albedo; float3 normal; +#if defined(_EMISSION) + float3 emission; +#endif float smoothness; float roughness; float roughness_perceptual; @@ -34,6 +37,10 @@ YumPbr GetYumPbr(v2f i) { float3x3 tangentToWorld = float3x3(i.tangent, i.binormal, i.normal); result.normal = normalize(mul(normal_raw, tangentToWorld)); +#if defined(_EMISSION) + result.emission = tex2D(_EmissionMap, UV_SCOFF(i, _EmissionMap_ST, /*which_channel=*/0)) * _EmissionColor; +#endif + #if defined(_METALLICS) float4 metallic_gloss = tex2D(_MetallicGlossMap, UV_SCOFF(i, _MetallicGlossMap_ST, /*which_channel=*/0)); float metallic = metallic_gloss.r * _Metallic; -- cgit v1.2.3