summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'yum_pbr.cginc')
-rw-r--r--yum_pbr.cginc7
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;