summaryrefslogtreecommitdiffstats
path: root/matcap.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-02-25 19:03:14 -0800
committeryum <yum.food.vr@gmail.com>2026-02-25 19:03:14 -0800
commit69dded4f94ab2f7e99b4959793a9eaf1f19aef07 (patch)
tree94a57f4b6da22b004c5c1d830b27f2bf0e3f88df /matcap.cginc
parente7c7b5e9fd1dc14755da97b0f4edb0bc92c744b3 (diff)
Fix matcap compiler bug & reorder UI
Diffstat (limited to 'matcap.cginc')
-rw-r--r--matcap.cginc4
1 files changed, 2 insertions, 2 deletions
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