Today I focused on getting the environment for my AI and Animation demo done with lights and models imported. Because I had most of what I need to start with from assignment 1 and tutorials, this was easy. The Marv model we get to use for animation of a character doesn’t have an actual material, so I applied a plain metal texture to him and then tinted him red.
The texture for the level, however, looks really crappy. I used a uniform and sent a “tileAmount” variable to the pixel shader to tell it how much to tile the texture on the level but it didn’t help.
The shader also has a fog setting, and a normal map texture sent to it.
I don’t know what the deal is with the pixelation that looks like noise. I guess I need to set up some sort of LOD or mipmapping so the textures blend a bit better…
That is a closeup of the wall behind Marv. It looks like white noise.
So, after browsing the net, I found that openGL can have mipmaps set up to work automatically (instead of creating them all yourself). http://www.swiftless.com/tutorials/opengl/mipmap_generation.html This could be a feature in this AI assignment for frustum culling.
The next steps were to try and find how FBX models animate. This stage was difficult as I had no idea how this worked and required a lot of digging around.
After digging around I managed to figure out:
- FBX models have a “skeleton” made of “bones”. “Bones” are basically just 4×4 matrices. This skeleton can be accessed with GetSkeletonByIndex( id )
- FBX models also have an “animation” which contains “tracks”. These “tracks” have “keyframes”. Each keyframe has a “rotation”, “translation” and “scale”. Animations can be accessed with GetAnimationByIndex( id )
- Animations contain “TotalTime” that can be used to loop.
What I couldn’t figure out is how the actual indices are affected by each bone. I mean, there’s bones in there, but what indices do they affect? This would need to be held in some sort of array as a bone could affect multiple indices. Then after I figure THAT out, I need to somehow throw them into the shader. An array maybe? I’ll do this tomorrow.