More stability work on cellular sim
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-12-09 11:26:33 -05:00
parent 662d9a83f2
commit 43ad5c3478
2 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@
/**
* Gravity transfer rate/threshold
*/
#define FLUID_CELLULAR_DIFFUSE_RATE_GRAV 0.11f
#define FLUID_CELLULAR_DIFFUSE_RATE_GRAV 0.5f
/**
* Minimum density for lateral movement to occur

View File

@ -859,10 +859,10 @@ LIBRARY_API void fluid_cellular_simulate(Environment * environment){
}
if(bounds[IX(nX,y,nZ)] <= BOUND_CUTOFF_VALUE){
if(d[IX(nX,y,nZ)] <= MAX_FLUID_VALUE - FLUID_CELLULAR_DIFFUSE_RATE2 && d[IX(nX,y,nZ)] < d[IX(x,y,z)]){
if(d[IX(nX,y,nZ)] <= MAX_FLUID_VALUE - (FLUID_CELLULAR_DIFFUSE_RATE2 * 2) && d[IX(nX,y,nZ)] < d[IX(x,y,z)]){
float transfer = FLUID_CELLULAR_DIFFUSE_RATE2;
if(d[IX(x,y,z)] < FLUID_CELLULAR_DIFFUSE_RATE2){
transfer = d[IX(x,y,z)];
if(d[IX(x,y,z)] - d[IX(nX,y,nZ)] < FLUID_CELLULAR_DIFFUSE_RATE2){
transfer = (d[IX(x,y,z)] - d[IX(nX,y,nZ)]) / 2.0f;
}
// if(realNeighborZ == 17 && realNeighborX == 8){
// printf("lateral\n");