From: Rob B. <rb...@bl...> - 2008-08-29 16:43:03
|
Hello Henri , yep I'm still here.. I think the #1 goal has to be "walk developers step by step through use of the API". I think to keep focus that we may need to set some explicit *non*-goals for a period of time, and here are a few I would suggest, since they don't help teach the API. a) SIMD optimization for the math lib. <- fun, but off course. b) anything that would tip the balance towards "web site authoring and maint" and away from making code. c) 3D geometry/math tutorials - we can link to any number of books/ sites for this stuff d) anything else that consumes calendar time at the expense of demo code. One class of example that might be interesting would be a Rosetta stone, where several ways to accomplish the same goal are shown. For example, simplest thing I can think of, a tumbling triangle. You can do it with all the math on the CPU and push finished verts to the GPU. You can then say "maybe I should do the rotation in the shader" and demonstrate how to hoist code from CPU to GPU and have it run in the shader. You could show one version where we compute the rotation matrix on the CPU and pass that as a uniform to be used trivially in the shader, then you could do one where (just for kicks) we pass Euler angles as uniforms and let the shader generate the matrix itself. We could do one where we pass non-Cartesian verts (azimuth/elevation and radius) and let the shader do polar-to-cartesian conversion. By the end of it you've learned a few different ways to push data from CPU to GPU and have it acted on. stops on the API-learning road.. please add some stops here - how do I establish a context and put it on the screen - make a window, init context, clear, swap - how do I put data in a buffer so GPU can see it - no drawing - just demonstrate the buffer API's - perhaps BufferData some floats into a buffer, then map it and print the values seen - how do I draw the simplest possible triangle - pass-through shader for vert position - "write red" for pixel - constant verts for geometry in a VBO - how can I change the color of the triangle - introduce per vertex color attribute - vertex shader passes it through - alter pixel shader to read it and emit it - introduction to uniforms - communicate to shaders - show color change using uniform (several ways to do this) - how can I move the triangle - see above that's a lot of good tutorial steps before we even start talking about more than one triangle. Ideally you get to the end of this phase and you have an idea of how to put data in a buffer, how to lay out some vertex data, how to draw a triangle, and how to communicate on a very basic level with the shaders, and no usage of deprecated APIs. Rob |