The controls are the same as before, WASD controls the camera, the Arrow keys control the cube, and IJKL controls the light source.
The troubles I ran into this week were all kind of trivial. First of all, I don't know if this was brought up in class, but the UV coordinates originate from the top left. It seems like each individual aspect of the DirectX graphics pipeline uses a different origin..
The second issue was I assumed the D3DCOLOR object in the s_vertex was size 12 because its three ints, but I guess I was wrong. That caused my texture to be drawn horribly wrong because I used the wrong offset into the struct. That took awhile to fix, really Sherly figured it out.
Another aggravating issue is I used the word texture in my fragment shader, which must be a keyword or something. I should probably get a syntax highlighting plugin. The error just said something like 'unexpected token texture'. I just changed it on a whim to texture_sample and it worked.
Finally, I couldn't tell if my light was actually moving at first because moving it at the same speed as the camera and the cube. I'm guessing changing it by 1 has such a minuscule effect on the angle hitting the cube that you have to move it really far to notice. I changed the controls to offset by 10 at a time and it works much nicer.
Here's my required screenshot.
And here's my code!
P.S. Jason and I worked together so that's why we wrote about the same issues.
No comments:
Post a Comment