It's likely that many of the shaders require features not available in the OpenGLES2 shaders. The VC4 manual tells you all about the QPUs (which are the processors that the shaders run on) and the texture units etc. albeit without telling you about any bugs in the implementations. It won't tell you how GLSL compiles into QPU code and register setups, for that read the Mesa source, though it compiles GLSL into an intermediary format or two (GLSL->hir->nir I think) before finally generating QPU code and register settings. It would be interesting to see the differences between VC4 and VC6 QPU code for the same shader, I assume VC6 has more instructions, I know it has more registers).Gavinmc42 wrote: ↑Sat Aug 10, 2019 12:37 amIn Tim's Readme it says only works on Pi4's.What gave you the impression that the VC4 didn't have shaders?
It looks like mesa is smart enough to figure that out and use the VC4 driver.
Dug out the VC4 manual, not much on shaders, need the VC6 manual, not that it will make much sense.
Think I need to look at the output of the shader compilers.
So far reading all the OpenGL books is leading me to conclude shaders are even more complex than just the 3D stuff.
In OpenGL polygons with four or more vertices have to be decomposed into triangles first (on the old 3dfx even lines were triangles, a line was drawn by drawing a triangle with two identical vertices), OpenGLES made the move to remove all higher order polygons from the start since it reduces complexity of the drivers and makes it the programmer's responsibility to convert higher order polygons into triangles. Those higher order polygons were then also removed from OpenGL as of version 3.1.Gavinmc42 wrote: ↑Sat Aug 10, 2019 12:37 amBeen putting off learning 3D on Pi's, it has been playing with OpenGL on the Pi4 that all the pieces fell into place.
I wondered why there was nothing between triangles and cubes and full objects in OpenGLES.
There is no library like FreeGLUT for OpenGLES.
Then Tim comes along and throws shaders into the mix.
Another new world of learning.
OpenGL3.1 was also the point where the fixed-function vertex and fragment sections were finally removed (they were deprecated in 3.0).
Shaders aren't all the complicated if you don't need them to be. Vertex shaders are just programs that transform vertices from object space to view space and fragment shaders are programs that generate the colour to use for each pixel of a triangle drawn.
It's impressive when you see everything drawn by shaders alone (the entire screen is just drawn as two triangles covering the window), just think how slow it would be if the CPU was drawing the scene pixel by pixel.