/rant
You would think that with a course focusing on shaders, that shaders would be the biggest challenge one faces. But I for some reason don't have much of a problem with them, its just the darn setup that goes along with it.
First of all there's not many resources for actual setup code for this stuff (that I can actually understand), and when there is its usually not quite what I'm looking for. I'm not clever or intuitive enough with programming to know how to adapt such things, so I work largely based on trial and error.
For example I've been working through the code to morph 2 obj's with a shader. The shader itself is fairly simple, it takes the source and destination vertices and perform's the lerp function between them at the specified intervals. That's all fine and dandy, and it makes sense to me, but I can't figure out how to get an obj loader to load 2 obj's -.-
I've been working off the TA's code but its more meant to load in a single object and then draw it. So I've been trying to figure out how to many an array or vector list to work with loading in several objects. And of course this naturally involves stuff like pointers and etc, meaning I suck at it. I still can't wrap my head around pointers, or why they are needed or what they really do (I get the theory behind it).
And then for the particle shader, I know the physics calculation and how to output the vertices based on the calculation, and the difference between uniform and varying, and how to use the TEXCOORD# semantic to get values for position, velocity etc. But there is this function in the CG examples called glMultiTexCoord, which is undefined no matter what version of glut and opengl I use. I know it can be used to pass in multiple values to the shader, but as it is I'm using glTexCoord and I'm fairly certain it just overwrites the value each time it is passed to the shader.
So on that front I'm stuck and looking for workaround solutions as well. In both cases I get the shader and how it works, but I don't understand the connection between the base code and it very well. So here's to more research and asking peers for help and whatnot, I know I'll get it sooner or later.
/endrant
No comments:
Post a Comment