diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-20 19:57:54 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-20 19:57:54 -0800 |
| commit | 72806ff9f71bd98973f51a4b67de00c056fe8d89 (patch) | |
| tree | 2a7d1ed7a8cbb563ed79ef18e363ef3b4efccd3a /2ner.cginc | |
| parent | 14cdf12e17d2b17676135457e42bde391ff3f313 (diff) | |
add eye shader
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -4,6 +4,7 @@ #include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
+#include "eyes.cginc"
#include "features.cginc"
#include "globals.cginc"
#include "interpolators.cginc"
@@ -59,6 +60,7 @@ v2f vert(appdata v) { o.pos = UnityObjectToClipPos(v.vertex);
o.uv01 = v.uv01;
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
+ o.objPos = v.vertex;
o.eyeVec.xyz = normalize(o.worldPos - _WorldSpaceCameraPos);
// These are used to convert normals from tangent space to world space.
@@ -83,8 +85,17 @@ float4 frag(v2f i) : SV_Target { // Not necessarily normalized after interpolation
i.normal = normalize(i.normal);
+#if defined(_EYE_EFFECT_00)
+ EyeEffectOutput eye_effect_00 = EyeEffect_00(i);
+ i.uv01.xy = eye_effect_00.uv;
+#endif
+
YumPbr pbr = GetYumPbr(i);
+#if defined(_EYE_EFFECT_00)
+ pbr.normal = eye_effect_00.normal;
+#endif
+
UNITY_BRANCH
if (_Mode == 1) {
clip(pbr.albedo.a - _Clip);
|
