diff options
Diffstat (limited to 'matcap.cginc')
| -rw-r--r-- | matcap.cginc | 4 |
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 |
