summaryrefslogtreecommitdiffstats
path: root/matcaps.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-01-20 22:15:09 -0800
committeryum <yum.food.vr@gmail.com>2026-01-20 22:15:09 -0800
commita54b415ab89302cf1f74f78360595ec0eff8fc7b (patch)
tree678cd3c8076c0c8995d6e1033f401738a22c1bea /matcaps.cginc
parentd24a5d839bad7ae0a9a6525f7c4d30fa0877e073 (diff)
Push eyeVec into fragment
Diffstat (limited to 'matcaps.cginc')
-rw-r--r--matcaps.cginc8
1 files changed, 4 insertions, 4 deletions
diff --git a/matcaps.cginc b/matcaps.cginc
index 6c84e54..067e322 100644
--- a/matcaps.cginc
+++ b/matcaps.cginc
@@ -8,9 +8,9 @@
#include "yum_pbr.cginc"
#if defined(_MATCAP0) || defined(_MATCAP1) || defined(_MATCAP2) || defined(_RIM_LIGHTING0) || defined(_RIM_LIGHTING1) || defined(_RIM_LIGHTING2) || defined(_RIM_LIGHTING3)
-float2 getMatcapUV(v2f i, inout YumPbr pbr) {
+float2 getMatcapUV(v2f i, f2f f, inout YumPbr 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.xyz, 0)));
+ const float3 cam_view_dir = normalize(mul(UNITY_MATRIX_V, float4(-f.eyeVec, 0)));
const float3 cam_refl = -reflect(cam_view_dir, cam_normal);
float m = 2.0 * sqrt(
cam_refl.x * cam_refl.x +
@@ -68,9 +68,9 @@ float getAngleAttenuation(float2 muv, float2 target_vector, float power) {
return pow(NoL, power);
}
-void applyMatcapsAndRimLighting(v2f i, inout YumPbr pbr, inout YumLighting l) {
+void applyMatcapsAndRimLighting(v2f i, f2f f, inout YumPbr pbr, inout YumLighting l) {
#if defined(_MATCAP0) || defined(_MATCAP1) || defined(_MATCAP2) || defined(_RIM_LIGHTING0) || defined(_RIM_LIGHTING1) || defined(_RIM_LIGHTING2) || defined(_RIM_LIGHTING3)
- float2 muv = getMatcapUV(i, pbr);
+ float2 muv = getMatcapUV(i, f, pbr);
#endif
#if defined(_MATCAP0)
#if defined(_MATCAP0_QUANTIZATION)