summaryrefslogtreecommitdiffstats
path: root/globals.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-09-24 13:57:26 -0700
committeryum <yum.food.vr@gmail.com>2024-09-24 13:57:26 -0700
commit2b9e36fde45c5f488539f390288e0a2731d11fcf (patch)
treeed12017282d6145830b512ec2cf1a6d2834e15c7 /globals.cginc
parent88a524d71bf46bca1c65c3f7ed5fcd3f6edd1d5e (diff)
World lighting fixes
* Add channel selection for roughness and metallic textures * This lets u combine roughness & metallic into one texture * Add Bakery-compatible emission slot * Add compile-time toggle for brightness clamping * Add toggle for world interpolators * Add emission type dropdown (baked/realtime/none) * Switch to bilinear filtering for base PBR maps to match standard shader behavior * Add bugfixes for Mochie BRDF in world lighting mode * Rename _NormalTex to _BumpMap for compatibility with standard shader * World lighting mode uses Unity baked GI logic instead of normal world lighting logic * Use uv2 instead of lmuv for lightmap UVs
Diffstat (limited to 'globals.cginc')
-rw-r--r--globals.cginc24
1 files changed, 18 insertions, 6 deletions
diff --git a/globals.cginc b/globals.cginc
index 64d3410..feaec79 100644
--- a/globals.cginc
+++ b/globals.cginc
@@ -5,6 +5,8 @@
SamplerState linear_repeat_s;
SamplerState linear_clamp_s;
+SamplerState bilinear_repeat_s;
+SamplerState bilinear_clamp_s;
float4 _Color;
float _Metallic;
@@ -43,8 +45,12 @@ float _FresnelStrength;
float _UseFresnel;
float _ReflectionStrength;
float3 shadowedReflections;
-float3 _ReflShadows;
-float3 _ReflShadowStrength;
+int _ReflShadows;
+float _ReflShadowStrength;
+float _BrightnessReflShad;
+float _ContrastReflShad;
+float _HDRReflShad;
+float3 _TintReflShad;
float _VRChatMirrorMode;
float3 _VRChatMirrorCameraPos;
@@ -89,11 +95,13 @@ float _SSRHeight;
texture2D _MainTex;
float4 _MainTex_ST;
#endif
-texture2D _NormalTex;
-float4 _NormalTex_ST;
+texture2D _BumpMap;
+float4 _BumpMap_ST;
texture2D _MetallicTex;
+float _MetallicTexChannel;
float4 _MetallicTex_ST;
texture2D _RoughnessTex;
+float _RoughnessTexChannel;
float4 _RoughnessTex_ST;
#if defined(_PBR_OVERLAY0)
@@ -257,15 +265,19 @@ float _Decal3_Angle;
float _Decal3_UV_Select;
#endif
+#if defined(_EMISSION)
+texture2D _EmissionMap;
+float3 _EmissionColor;
+#endif
#if defined(_EMISSION0)
texture2D _Emission0Tex;
-float _Emission0Strength;
+float3 _Emission0Color;
float _Emission0Multiplier;
float _Emission0_UV_Select;
#endif
#if defined(_EMISSION1)
texture2D _Emission1Tex;
-float _Emission1Strength;
+float3 _Emission1Color;
float _Emission1Multiplier;
float _Emission1_UV_Select;
#endif