I have been trying to learn OpenGL, specifically for Android. I have seen various tutorials online, and I noticed that many of the tutorials for OpenGL 1.0, or 1.2 do not require compilation of shader programs, while the only tutorials I could find for OpenGL 2.0 all involve creating a custom shader to render shapes in the view.
The process of using a string to hold code (GLSL) and then compiling and linking this code at run-time feels cumbersome (hacky even). Is this necessary because GPU architectures can vary greatly?
Is there a way to use some kind of default shaders that don't require this step (like a built in shader)? I just want to be able to draw primitives like GL_POINTS, GL_LINES, etc.
Is this necessary because GPU architectures can vary greatly?
Yes indeed and while there has been mentioning of an IR version of shaders there hasn't been a proper consensus about how it should look.
You can use glShaderBinary to precompile the shader in a previous run and reuse the compiled output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With