I am tryng to upgrade ofxFluid from glsl version 120 to 150 because my app needs OpenGL versione 3.2. The shaders are quite simple but I am not expert and probably I made some error in transaltion… the result, in fact, is a black screen (no errors on console). here is the first one, very similar to the others. If someone see any error I will appreciate any feedback, thanks!
Hey @Paolo , this shader code looks pretty good to me. I haven’t found any errors yet. One thing to remember is that #version 150 in the shaders corresponds with openGL version 3.2. So don’t forget to set the openGL version in main.cpp:
int main() {
ofGLFWWindowSettings settings;
settings.setGLVersion(3, 2);
settings.setSize(1920, 1080);
auto window = ofCreateWindow(settings);
ofRunApp(window, make_shared<ofApp>());
ofRunMainLoop();
}
I removed all but one shader from ofxFluid and verified that something appeared on the screen in version 120. Once I verified that the pipeline was working, I changed the openGL setting from 2.1 to 3.2 and loaded version 150 of the same shader. I did this to minimize the lines of code where to look for the error.
On version 150 I no longer see anything, but if I add ofDrawRectangle(…) between shader.begin() and shader.end() the app crashes and Mac Os Ventura on console reports “FALLBACK (log once): Fallback to SW vertex processing, m_disable_code: 10”.
the next test will be to run the same code on Windows 10 and try to see if the problem is due to OpenGL on Mac. Actually the 01_simpleColorQuad example from OpenFrameworks works correctly even with OpenGL 3.2, so there should be no problem with ofxFluid with shader version 150 on MacOS Ventura.
Hey one more quick thought. Have the vertex shaders been modified (or added) for openGL 3.2? The OF examples in /shader have both openGL 2.1 and 3.2, and the vertex shaders are different between the two versions. I had a quick look at ofxFluid.cpp and didn’t see where the vertex shader(s) were setup from source like the fragment shaders are.
The OF projects from /examples/shader for openGL 3.2 should definitely run on macOS.
on Windows, if I draw the quad by ofDrawRectangle it works but I have to flip coords. On Mac I still have the Fallback issue. I’ve just removed dependency from ofxFX and the bug, now, has to be found in less than 100 lines of code. I hope to catch it soon.