Code cleanup, rework, additional code comments
This commit is contained in:
parent
fe46cef0a7
commit
dec7d2e9f8
5 changed files with 206 additions and 290 deletions
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2020 Google LLC
|
||||
// Copyright 2023 Sascha Willems
|
||||
|
||||
struct Particle {
|
||||
float4 pos;
|
||||
float4 vel;
|
||||
float4 uv;
|
||||
float4 normal;
|
||||
float pinned;
|
||||
};
|
||||
|
||||
[[vk::binding(0)]]
|
||||
|
|
@ -54,13 +54,6 @@ void main(uint3 id : SV_DispatchThreadID)
|
|||
if (index > params.particleCount.x * params.particleCount.y)
|
||||
return;
|
||||
|
||||
// Pinned?
|
||||
if (particleIn[index].pinned == 1.0) {
|
||||
particleOut[index].pos = particleOut[index].pos;
|
||||
particleOut[index].vel = float4(0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Initial force from gravity
|
||||
float3 force = params.gravity.xyz * params.particleMass;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue