diff options
| author | yum <yum.food.vr@gmail.com> | 2025-10-17 21:24:29 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-10-17 21:24:29 -0700 |
| commit | ddf847e758d9766d33ccc9b1a560a84142e395e0 (patch) | |
| tree | 3ac90042d3bdcfd73b93d6f2d374a6134bc0b7ab /vertex.cginc | |
| parent | 98e115ebfc40e72a8ee1c6453735d8f6076f7890 (diff) | |
fix how normals are calculated with multiple modifiers on
Diffstat (limited to 'vertex.cginc')
| -rw-r--r-- | vertex.cginc | 10 |
1 files changed, 5 insertions, 5 deletions
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 |
