From ddf847e758d9766d33ccc9b1a560a84142e395e0 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 17 Oct 2025 21:24:29 -0700 Subject: fix how normals are calculated with multiple modifiers on --- vertex.cginc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vertex.cginc') diff --git a/vertex.cginc b/vertex.cginc index a18215a..84185c6 100644 --- a/vertex.cginc +++ b/vertex.cginc @@ -39,8 +39,8 @@ void deform(inout float3 objPos) { float t = _Time[3]; float3 amplitude = _Vertex_Deformation_Sine_Waves_Amplitude; float3 direction = _Vertex_Deformation_Sine_Waves_Direction; - float4 k = _Vertex_Deformation_Sine_Waves_k; - float4 omega = _Vertex_Deformation_Sine_Waves_omega; + float3 k = _Vertex_Deformation_Sine_Waves_k; + float3 omega = _Vertex_Deformation_Sine_Waves_omega; objPos = sine_wave(objPos.xyz, amplitude, direction, k, omega, t); } #endif // _VERTEX_DEFORMATION_SINE_WAVES @@ -76,10 +76,10 @@ void deform_normal(float3 objPos, inout float3 objNorm, inout float3 objTan) { #if defined(_VERTEX_DEFORMATION_SINE_WAVES) { float t = _Time[3]; - float4 amplitude = _Vertex_Deformation_Sine_Waves_Amplitude; + float3 amplitude = _Vertex_Deformation_Sine_Waves_Amplitude; float3 direction = _Vertex_Deformation_Sine_Waves_Direction; - float4 k = _Vertex_Deformation_Sine_Waves_k; - float4 omega = _Vertex_Deformation_Sine_Waves_omega; + float3 k = _Vertex_Deformation_Sine_Waves_k; + float3 omega = _Vertex_Deformation_Sine_Waves_omega; sine_wave_normal(objPos, objNorm, objTan, amplitude, direction, k, omega, t); } #endif // _VERTEX_DEFORMATION_SINE_WAVES -- cgit v1.2.3