diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-22 22:06:04 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-22 22:06:04 -0700 |
| commit | 5393f1c9a3b6cfeae53ebba4fb10f4eb6d91fbf7 (patch) | |
| tree | b4070397fd2ea14a0de81fd3ba0f6e8a2745b8ab | |
| parent | 81a25ecf2360018e22209ab27bae60bbb993aaa5 (diff) | |
add grayscale lightmap toggle
| -rw-r--r-- | 2ner.shader | 28 | ||||
| -rw-r--r-- | features.cginc | 4 | ||||
| -rw-r--r-- | yum_lighting.cginc | 3 |
3 files changed, 24 insertions, 11 deletions
diff --git a/2ner.shader b/2ner.shader index 4d12995..fa03778 100644 --- a/2ner.shader +++ b/2ner.shader @@ -1866,17 +1866,6 @@ Shader "yum_food/2ner" [HideInInspector] m_end_Fallback_Cubemap_Limit_Metallic("Limit override to metallic", Float) = 0 [HideInInspector] m_end_Fallback_Cubemap("Fallback Cubemap", Float) = 0 //endex - //ifex _Receive_Shadows_Enabled==0 - [HideInInspector] m_start_Shadow_Receiving("Receive shadows", Float) = 0 - [ThryToggle(_RECEIVE_SHADOWS)] _Receive_Shadows_Enabled("Enable", Float) = 1 - _Shadow_Strength("Shadow strength", Range(0, 1)) = 0.25 - [HideInInspector] m_end_Shadow_Receiving("Shadows", Float) = 0 - //endex - //ifex _Cast_Shadows_Enabled==0 - [HideInInspector] m_start_Shadow_Casting("Cast shadows", Float) = 0 - [ThryToggle(_CAST_SHADOWS)] _Cast_Shadows_Enabled("Enable", Float) = 1 - [HideInInspector] m_end_Shadow_Casting("Cast shadows", Float) = 0 - //endex //ifex _Wrapped_Lighting_Enabled==0 [HideInInspector] m_start_WrappedLighting("Wrapped lighting", Float) = 0 [ThryToggle(_WRAPPED_LIGHTING)] _Wrapped_Lighting_Enabled("Enable", Float) = 1 @@ -1916,6 +1905,11 @@ Shader "yum_food/2ner" _LTCGI_DiffuseColor("Diffuse color", Color) = (1, 1, 1, 1) [HideInInspector] m_end_LTCGI("LTCGI", Float) = 0 //endex + //ifex _Grayscale_Lightmaps_Enabled==0 + [HideInInspector] m_start_Grayscale_Lightmaps("Grayscale Lightmaps", Float) = 0 + [ThryToggle(_GRAYSCALE_LIGHTMAPS)] _Grayscale_Lightmaps_Enabled("Enable", Float) = 0 + [HideInInspector] m_end_Grayscale_Lightmaps("Grayscale Lightmaps", Float) = 0 + //endex [HideInInspector] m_renderingOptions("Rendering Options", Float) = 0 @@ -1925,6 +1919,18 @@ Shader "yum_food/2ner" [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Destination Blend", Float) = 0 [Enum(Off, 0, On, 1)] _ZWrite("ZWrite", Int) = 1 + //ifex _Receive_Shadows_Enabled==0 + [HideInInspector] m_start_Shadow_Receiving("Receive shadows", Float) = 0 + [ThryToggle(_RECEIVE_SHADOWS)] _Receive_Shadows_Enabled("Enable", Float) = 1 + _Shadow_Strength("Shadow strength", Range(0, 1)) = 0.25 + [HideInInspector] m_end_Shadow_Receiving("Shadows", Float) = 0 + //endex + //ifex _Cast_Shadows_Enabled==0 + [HideInInspector] m_start_Shadow_Casting("Cast shadows", Float) = 0 + [ThryToggle(_CAST_SHADOWS)] _Cast_Shadows_Enabled("Enable", Float) = 1 + [HideInInspector] m_end_Shadow_Casting("Cast shadows", Float) = 0 + //endex + //ifex _Depth_Prepass_Enabled==0 [HideInInspector] m_start_Depth_Prepass("Depth Prepass", Float) = 0 [ThryToggle(_DEPTH_PREPASS)] _Depth_Prepass_Enabled("Enable", Float) = 0 diff --git a/features.cginc b/features.cginc index e1f7ef0..98f1141 100644 --- a/features.cginc +++ b/features.cginc @@ -369,5 +369,9 @@ #pragma shader_feature_local _OKLCH_CORRECTION //endex +//ifex _Grayscale_Lightmaps_Enabled==0 +#pragma shader_feature_local _GRAYSCALE_LIGHTMAPS +//endex + #endif // __FEATURES_INC diff --git a/yum_lighting.cginc b/yum_lighting.cginc index af082b0..22d1a0b 100644 --- a/yum_lighting.cginc +++ b/yum_lighting.cginc @@ -259,6 +259,9 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { light.occlusion, // out occlusion light.derivedLight // out Light ); +#if defined(_GRAYSCALE_LIGHTMAPS) + light.diffuse.gb = light.diffuse.r; +#endif #if defined(_MIN_BRIGHTNESS) light.diffuse = max(_Min_Brightness, light.diffuse); |
