I m working on a framework that features render to texture and post-processing effects in OpenFL 2.2.8 native v2. My program works on machines with OpenGL version 4.4 and 3.3, but when I try it on a machine with OpenGL 2.1, the program stops working. https://github.com/bmfs/glslTest_openfl this program also stops working on the said machine while it runs fine on newer ones.
After some research I found out that FBOs are not core in OpenGL version 2.1, but when I go to http://glslsandbox.com/ the shaders run just fine (I can see in their gitHub code they used FBOs). The WebGL version support on this machine is 1.0. Is there anything I need to know to solve this problem?
Yes I believe that an extension is needed for FBO to work in 2.1. I am not an expert in OpenGL so I can’t add it into lime myself… http://prideout.net/archive/bloom/ this tutorial uses OpenGL 2.0 and it has EXT suffixes on framebuffer related functions and stuffs.
Will this be something to come in newer versions of OpenFL 3.0? If I guessed it right, the new BitmapData filter uses GPU which I think has something to with FBO, since you are using OpenGL for GPU shaders. Therefore this compatibility issue might affect the newer versions as well @singmajesty
If you have not built Lime from source, try looking at the README on https://github.com/openfl/lime for build steps (pretty simple)
In the newer code, it uses these C++ files when binding to OpenGL:
I think the solution would be detecting if the system does not have FBO support in GL, but does have an extension. I’m not sure if it would require just loading the extension, or using a different reference than the standard GL function calls, in order to use them
One of the strange thing is, using WebGL on the said computer, GL.createFrameBuffer() works just fine, without using extensions. Does WebGL include the extension detection and everything and deal with it automatically? cuz this does not make sense…
if you are on Windows chances are that the browsers are using ANGLE for openGL compatibility with old hardware / buggy drivers. OpenFL might use it too in the future.
Bravo, problem solved. Chrome is indeed using ANGLE. Thanks a lot
This thread mentioned including ANGLE library for SDL and rebuilding lime. I would say the steps will be very simple if you want to add this feature into newer versions of OpenFL. Can’t wait!