I implemented 2d fluid simulator. Solver runs entirely on GPU. All works fine... on my work PC. But on home PC I have some awful glitches, and I can`t understand how to fix them. Empirically I discovered that problem is localized somewhere in advect program. This is very strange cause at work I have integrated video, and at home — NVIDIA GeForce 9800 GT. Here is the GLSL source of advect program (some lines were dropped for clearness):
#version 130
out vec3 value;
uniform sampler2D q;
uniform sampler2D velocity;
uniform float dt;
uniform float inverseSize;
void main()
{
vec2 p = gl_FragCoord.xy * inverseSize;
vec2 np = p - dt * texture(velocity, p).xy;
value = texture(q, np).xyz;
}
And some screenshots.
Work PC:
Home PC: