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
Hi @PavelDoGreat, thanks for sharing the code, this is an amazing implementation.
I'm trying to translate this to compute shaders as a way of learning more about compute and also Vulkan. I've gotten pretty far, but my simulation doesn't seem to behave correctly at the boundaries, as yours does.
Reading through GPU gems, it looks like there should be a special case on the boundaries for both velocity and pressure. It looks like somehow you're handling this in your divergence shader with this segment:
if (vL.x < 0.0) { L = -C.x; }
if (vR.x > 1.0) { R = -C.x; }
if (vT.y > 1.0) { T = -C.y; }
if (vB.y < 0.0) { B = -C.y; }
But my question is, do you account for the boundary conditions in any other way, or should this be sufficient?
Best,
Spencer
The text was updated successfully, but these errors were encountered:
@spencerkohan Hey. I know little about compute shaders at the moment. I may assume that compute shaders doesn't do texture boundary checks as fragment shaders do. In my simulation when I initialize textures and framebuffers, I set parameter CLAMP_TO_EDGE, which clamps texture accessing coordinate in fragment shader to 0-1.
Hi @PavelDoGreat, thanks for sharing the code, this is an amazing implementation.
I'm trying to translate this to compute shaders as a way of learning more about compute and also Vulkan. I've gotten pretty far, but my simulation doesn't seem to behave correctly at the boundaries, as yours does.
Reading through GPU gems, it looks like there should be a special case on the boundaries for both velocity and pressure. It looks like somehow you're handling this in your divergence shader with this segment:
But my question is, do you account for the boundary conditions in any other way, or should this be sufficient?
Best,
Spencer
The text was updated successfully, but these errors were encountered: