Original Post
[wrong forum before] hey guys, i've been doing some gpgpu programming for work recently, and i'm just in the last week using some of the quick prototyping tools i've developed for fun. a couple of years ago i put together a stam-style fluid simulator, and i had read the gpu gems article a while back from mark harris, so i figured that would be fun to implement. *however*, my advection code is not working, and while it's probably just a bug (though the shader code is very simple), now that i think about it, i don't understand how it could work at all (which it clearly does, as my cpu based version works great). basically i'm getting discontinuities in the flow, where on one cell the velocity field will be pointed to the right and in the next it will still be 0, and any force added to the field will only move up to that discontinuity and not pass it, unless you put a force right on top of it. this is the wrong behavior (as far as i can tell), but it got me thinking about how it should work in general. my question: if a cell's velocity is based on a sample of the field located at its position - (dt*its current velocity) but its current velocity is zero, how could it ever sample anything but itself? is diffusion the only mechanism to combat this (it can't be since harris doesnt even implement diffusion due to inaccuracy in the advect step)? i know theres probably a simple explanation and my brain is just blanking, so any help would be greatly appreciated! [Edited by - justo on May 10, 2006 12:46:46 PM]