From 69dded4f94ab2f7e99b4959793a9eaf1f19aef07 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 25 Feb 2026 19:03:14 -0800 Subject: Fix matcap compiler bug & reorder UI --- matcap.cginc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'matcap.cginc') diff --git a/matcap.cginc b/matcap.cginc index c34d294..55eff5a 100644 --- a/matcap.cginc +++ b/matcap.cginc @@ -9,7 +9,7 @@ #if defined(_MATCAP0) || defined(_RIM_LIGHTING0) float2 getMatcapUV(v2f i, Pbr pbr) { const float3 cam_normal = normalize(mul(UNITY_MATRIX_V, float4(pbr.normal, 0))); - const float3 cam_view_dir = normalize(mul(UNITY_MATRIX_V, float4(-i.eyeVec, 0))); + const float3 cam_view_dir = normalize(mul(UNITY_MATRIX_V, float4(-i.eyeVec.xyz, 0))); const float3 cam_refl = -reflect(cam_view_dir, cam_normal); float m = 2.0 * sqrt( cam_refl.x * cam_refl.x + @@ -92,7 +92,7 @@ void applyMatcapsAndRimLighting(v2f i, inout Pbr pbr, inout LightData light_data #if defined(_RIM_LIGHTING0_QUANTIZATION) rl0_dist = floor(rl0_dist * _Rim_Lighting0_Quantization_Steps) / _Rim_Lighting0_Quantization_Steps; #endif - float3 rl0 = _Rim_Lighting0_Color * rl0_dist; + float3 rl0 = lerp(1, _Rim_Lighting0_Color, rl0_dist); #if defined(_RIM_LIGHTING0_MASK) float rl0_mask = _Rim_Lighting0_Mask.Sample(linear_repeat_s, UV_SCOFF(i, _Rim_Lighting0_Mask_ST, /*which_channel=*/0)); #else -- cgit v1.2.3