I owe very much to openFrameworks yet I haven’t had time to give back to the community due to lack of time. I want to slowly make up for it so here is something I did a few weeks ago when I started the GLSL Orange Book Third Edition. It is a somewhat complete port of the infamous ogl2brick-2.0 found in Chapter 6 - Simple Shading Example (yes… very simple I’m sure O_o ).
Anyways, I got the teapot coordenates from somewhere else and the torus formula can easily be found by reviewing my port and googling it. I mention this because I’m sure I’m infringing some copyright law by posting this material, specially the teapot patchdata, but those are not the focus of this example, the purpose of it is rendering a texture using shaders and using said texture on some 3D model. The teapot and the torus code can be deleted if the mod wants me to.
I believe the example is relevant since the proper documentation for GLSL is the Orange Book and this port makes it easier to understand some functional differences.
Also, the port comes from the Orange Book’s examples that is written in c (I think), I haven’t had time to clean up the code so some variables like inertia are not used. It is a very functional port but not a complete one, although the shader part is identical.
I’ve posted 2 zip files, one is the src directory+data with the shaders, the other is the Xcode 4.6.1 project files.
One last thing, I am also posting this because I am currently learning shaders on some other thread, any help would be appreciated.