Added random vel to blood

This commit is contained in:
SpoodyTheOne 2024-02-04 00:39:58 +01:00
parent fc295808e9
commit 6c8750768b
2 changed files with 4 additions and 5 deletions

View File

@ -264,6 +264,8 @@ public class BloodComputeShader : MonoBehaviour
bloodCompute.SetVector("particleInitPos", loc); bloodCompute.SetVector("particleInitPos", loc);
bloodCompute.SetInt("particlesToInitialize", found); bloodCompute.SetInt("particlesToInitialize", found);
bloodCompute.SetVector("initialVelocity",Random.insideUnitCircle);
ComputeHelper.Dispatch(bloodCompute, amount, 1, 1, InitDustKernel); ComputeHelper.Dispatch(bloodCompute, amount, 1, 1, InitDustKernel);
activeParticles += found; activeParticles += found;

View File

@ -15,11 +15,8 @@ RWStructuredBuffer<uint> freeParticles;
uint numParticles; uint numParticles;
uint particlesToInitialize; uint particlesToInitialize;
float3 particleInitPos; float3 particleInitPos;
float3 initialVelocity;
float deltaTime; float deltaTime;
// float3 attractPos;
// float3 xAxis;
// float attractRadius;
// float attractForce;
float3 mop1Pos; float3 mop1Pos;
float3 mop2Pos; float3 mop2Pos;
@ -84,7 +81,7 @@ void InitDust (uint3 id : SV_DispatchThreadID)
randState = hash(randState); randState = hash(randState);
nvel.xy *= scaleToRange01(randState); nvel.xy *= scaleToRange01(randState);
particles[i].velocity = nvel; particles[i].velocity = initialVelocity + nvel;
particles[i].position = particleInitPos; particles[i].position = particleInitPos;
particles[i].position.z = 0.01; particles[i].position.z = 0.01;