From 5f84c37a4e95503f28540780c3257f8689cccef9 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 28 Mar 2025 19:35:57 -0700 Subject: add shader inliner --- shatter_wave.cginc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'shatter_wave.cginc') diff --git a/shatter_wave.cginc b/shatter_wave.cginc index 4df67db..8636df6 100644 --- a/shatter_wave.cginc +++ b/shatter_wave.cginc @@ -78,10 +78,11 @@ void shatterWaveVert(inout float3 objPos, float3 objNormal, float3 objTangent) { } #endif - for (uint i = 0; i < 4; i++) { - float offset = exp(-abs(distance_signed[i]) * _Shatter_Wave_Power[i]) * _Shatter_Wave_Amplitude[i]; - objPos += objNormal * offset; - } + float4 offset = exp(-abs(distance_signed) * _Shatter_Wave_Power) * _Shatter_Wave_Amplitude; + objPos += objNormal * offset[0]; + objPos += objNormal * offset[1]; + objPos += objNormal * offset[2]; + objPos += objNormal * offset[3]; } void shatterWaveFrag(inout float3 normal, float3 objPos) { -- cgit v1.2.3