You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the StableFluid - Solver2D.cs, you didn't assign texture for the Project-Step2 kernel and it causes an error on Unity 2019 version. It is fine on Unity2017 but can be an issue on Unity2019.
I would suggest you add below code at line 93 and 117. computeShader.SetTexture(kernelMap[ComputeKernels.ProjectStep2], velocityId, velocityTex);
And also on the Solver2D.compute, on 'AdvectVelocity' kernel function,
at line 234, you used GetDimensions(w,h) using density texturebuffer which requires SetTexture(density),
in this context, using velocity texturebuffer is better way to solve the error.
(x) density.GetDimensions(w, h);
(o) velocity.GetDimensions(w, h);
But after fixing those things, there is a weird horizontal artefact for the fluid simulation.
I am having look at it and once I solve the problem, I will share it as well.
Activity
wonkee-kim commentedon Oct 16, 2019
But after fixing those things, there is a weird horizontal artefact for the fluid simulation.
I am having look at it and once I solve the problem, I will share it as well.
lkewis commentedon Oct 4, 2021
Not sure if you already fixed this, but adding *-0.5 ** before the sampling in ProjectStep2 seems to have fixed it (same as ProjectStep1):
`[numthreads(THREAD_X, THREAD_Y, THREAD_Z)]
void ProjectStep2 (uint2 id : SV_DispatchThreadID)
{
uint w, h;
velocity.GetDimensions(w, h);
}`