More fluid simulation settings

This commit is contained in:
Dynamitos committed 2026-10-13 17:24:55 +02:00
1 parent b1004d5c80
commit f2a3f59ab1
5 files changed
+221 -19

No files matched your search

+8
View File
@@ -76,6 +76,14 @@ void setBound(uint3 dispatchThreadID : SV_DispatchThreadID)
if (numAffecting > 0)
{
// For all quantities (velocity components AND scalars: pressure,
// divergence, density) the boundary cell takes the (factor-scaled)
// interior neighbor value. For scalars the factor is 1 (Neumann / copy),
// which is the correct boundary condition for the pressure Poisson solve
// (zero normal gradient) and for the divergence. Do NOT zero the scalar
// boundary: zeroing the pressure shell breaks the Poisson Neumann
// condition, corrupts the projection, and injects energy into the
// velocity field (observed as |vel|_sum runaway).
grid[uint3(pos)] = valueSum / float(numAffecting);
}
}