diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-20 18:48:18 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-20 18:48:18 -0800 |
| commit | 14cdf12e17d2b17676135457e42bde391ff3f313 (patch) | |
| tree | c1a9d73cc0e3daed83b2d2c3e005284e0cbfaeab /yum_pbr.cginc | |
| parent | 01eeb68639ee4e3a5aeacf321c35a46c7dfe5c3d (diff) | |
Add emission, fine-tune quantized specular
Diffstat (limited to 'yum_pbr.cginc')
| -rw-r--r-- | yum_pbr.cginc | 7 |
1 files changed, 7 insertions, 0 deletions
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; |
