At one point, I'm a little lost though. I need to input custom vertex attributes to the vertex shader. The gl-shader-attributes sample does the following:
- Code: Select all
- shader:setVertexAttribute ( 1, 'position' )
- shader:setVertexAttribute ( 2, 'uv' )
- shader:setVertexAttribute ( 3, 'color' )
To me, it seems as indices 1, 2, and 3 are hard coded into the SDK at some point, since I can't see any place where they are defined. Is this correct? (Does this have anything to do with NVIDIAs supposedly non-conformant usage, as described here: http://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/attributes.php ?)
Second question: is it possible to define custom vertex attributes to be passed into the vertex shader? Is this what MOAIVertexBuffer/MOAIVertexFormat is for? If so, how are they used in the context of MOAIShader? (The gl-vertexBuffer sample only demonstrates usage together with MOAIMesh.)
Any illuminating comments would be greatly appreciated. Thanks!