v · ∇ v = dot(v,vec3( ∂v/∂x, ∂v/∂y, ∂v/∂z)) = v.x * ∂v/∂x +
v.y * ∂v/∂y + v.z * ∂v/∂z
vec4 C = texture2D(srcTex,texCoords); /* center pixel, for
vel estimate */
vec2 dir = C.xy; /* my velocity */
vec2 tc = texCoords - vel*dir; /* move "upwind" */
C = texture2D(srcTex,tc); /* advected source center pixel */
Demo: fluid advection via
upwind coordinate shift