diff options
| author | yum <yum.food.vr@gmail.com> | 2024-09-24 13:57:26 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-09-24 13:57:26 -0700 |
| commit | 2b9e36fde45c5f488539f390288e0a2731d11fcf (patch) | |
| tree | ed12017282d6145830b512ec2cf1a6d2834e15c7 /interpolators.cginc | |
| parent | 88a524d71bf46bca1c65c3f7ed5fcd3f6edd1d5e (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 'interpolators.cginc')
| -rw-r--r-- | interpolators.cginc | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/interpolators.cginc b/interpolators.cginc index 3b9bdcd..bbe4742 100644 --- a/interpolators.cginc +++ b/interpolators.cginc @@ -12,11 +12,15 @@ struct appdata float2 uv0 : TEXCOORD0; float2 uv1 : TEXCOORD1; float2 uv2 : TEXCOORD2; +#if defined(_WORLD_INTERPOLATORS) + UNITY_LIGHTING_COORDS(3, 4) +#else float2 uv3 : TEXCOORD3; float2 uv4 : TEXCOORD4; float2 uv5 : TEXCOORD5; float2 uv6 : TEXCOORD6; float2 uv7 : TEXCOORD7; +#endif UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -27,14 +31,16 @@ struct v2f float2 uv0 : TEXCOORD0; float2 uv1 : TEXCOORD1; float2 uv2 : TEXCOORD2; +#if defined(_WORLD_INTERPOLATORS) + UNITY_LIGHTING_COORDS(2, 3) +#else float2 uv3 : TEXCOORD3; float2 uv4 : TEXCOORD4; float2 uv5 : TEXCOORD5; float2 uv6 : TEXCOORD6; float2 uv7 : TEXCOORD7; - #if defined(LIGHTMAP_ON) - float2 lmuv : TEXCOORD8; - #endif + SHADOW_COORDS(8) +#endif float3 worldPos : TEXCOORD9; float3 normal : TEXCOORD10; float3 objPos : TEXCOORD11; @@ -52,11 +58,15 @@ struct appdata float2 uv0 : TEXCOORD0; float2 uv1 : TEXCOORD1; float2 uv2 : TEXCOORD2; +#if defined(_WORLD_INTERPOLATORS) + UNITY_LIGHTING_COORDS(2, 3) +#else float2 uv3 : TEXCOORD3; float2 uv4 : TEXCOORD4; float2 uv5 : TEXCOORD5; float2 uv6 : TEXCOORD6; float2 uv7 : TEXCOORD7; +#endif float3 normal : NORMAL; float4 tangent : TANGENT; @@ -69,23 +79,24 @@ struct v2f float2 uv0 : TEXCOORD0; float2 uv1 : TEXCOORD1; float2 uv2 : TEXCOORD2; +#if defined(_WORLD_INTERPOLATORS) + UNITY_LIGHTING_COORDS(2, 3) +#else float2 uv3 : TEXCOORD3; float2 uv4 : TEXCOORD4; float2 uv5 : TEXCOORD5; float2 uv6 : TEXCOORD6; float2 uv7 : TEXCOORD7; - #if defined(LIGHTMAP_ON) - float2 lmuv : TEXCOORD8; - #endif + SHADOW_COORDS(8) +#endif float3 normal : TEXCOORD9; float4 tangent : TEXCOORD10; float3 worldPos : TEXCOORD11; float3 objPos : TEXCOORD12; float3 centerCamPos : TEXCOORD13; - SHADOW_COORDS(14) #if defined(VERTEXLIGHT_ON) - float3 vertexLightColor : TEXCOORD15; + float3 vertexLightColor : TEXCOORD14; #endif UNITY_VERTEX_INPUT_INSTANCE_ID |
