ofxFluid
ofxFluid copied to clipboard
unable to get obstacles to work.
I had thought the problem was the advect fragment shader which does not seem to be initialized in the same format as the others. Currently activating the obstacles will cause the flow mechanism to stop working, even if you include a toggle that turns the obstacles back off afterwards..
I get this error, and I am not sure if it is part of the cause of this or not: [ error ] ofGLUtils: ofGetGLFormatFromInternal(): unknown internal format 34843, returning GL_RGBA
I tried initializing the advect fragment shader but it failed to compile:
// ADVECT
string fragmentShader = STRINGIFY(uniform sampler2DRect tex0; // Real obstacles
uniform sampler2DRect backbuffer;
uniform sampler2DRect VelocityTexture;
uniform float TimeStep;
uniform float Dissipation;
void main(){
vec2 st = gl_TexCoord[0].st;
float solid = texture2DRect(tex0, st).r;
if (solid > 0.1) {
gl_FragColor = vec4(0.0,0.0,0.0,0.0);
return;
}
vec2 u = texture2DRect(VelocityTexture, st).rg;
vec2 coord = st - TimeStep * u;
gl_FragColor = Dissipation * texture2DRect(backbuffer, coord);
}
);
shader.unload();
shader.setupShaderFromSource(GL_FRAGMENT_SHADER, fragmentShader);
shader.linkProgram();
this throws an error: [ error ] ofShader: checkProgramLinkStatus(): program failed to link [ error ] ofShader: ofShader: program reports: ERROR: Compiled fragment shader was corrupt.
I am still trying to parse the code for how the obstacles are utilized, but perhaps some insight into how you intended them to work would be helpful. I tried using the same shader code as the jacobi shader, but that does not work either.
Thanks.
This problem with the obstacles not working seems to be a machos 10.11 El Capitan problem. I have tried it with yosemite and it is working properly.