From 333562544ef1b71a7a4d7ce1ece533bef98ce0da Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 14 Jan 2025 21:01:26 -0800 Subject: im going to kill myself attempt to fix hypotrochoid normals key insight is that multiplying normal by transpose(invert(jacobian)) of transform should work, but it fucking doesn't --- mochie_shadow_caster.cginc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mochie_shadow_caster.cginc') diff --git a/mochie_shadow_caster.cginc b/mochie_shadow_caster.cginc index 64f6350..0d15d41 100644 --- a/mochie_shadow_caster.cginc +++ b/mochie_shadow_caster.cginc @@ -1,5 +1,8 @@ +#include "UnityCG.cginc" + #include "atrix256.cginc" #include "gerstner.cginc" +#include "trochoid_math.cginc" #ifndef __MOCHIE_SHADOW_CASTER_INC #define __MOCHIE_SHADOW_CASTER_INC @@ -60,6 +63,11 @@ v2f vert (appdata v){ return (v2f) (0.0 / 0.0); } #endif +#if defined(_TROCHOID) + { + v.vertex.xyz = cyl2_to_troch_map(cyl_to_cyl2_map(cart_to_cyl_map(v.vertex.xyz))); + } +#endif #if !defined(_SCROLL) && defined(_GIMMICK_GERSTNER_WATER) { GerstnerParams p = getGerstnerParams(); -- cgit v1.2.3