I have my last exam on the 28th, so I won’t post again until after that is done. In the meantime, have a look at the current state of the game below.
PS3 shaders can use a maximum of 512 instructions, the high detail terrain shader hit that limit today, while I was doing the finishing touches on the normal mapping, seen in the picture above. I reduced the maximum number of point lights that the shader can draw to compensate.
Seeing this scene animated is pretty cool, I’ll have some money next week with which to buy a new GPU, so that I can demonstrate that.
Getting the detail normal mapping to display correctly on steep slopes (or even not very steep slopes) was tricky. The detail normals have to be rotated to fit on the terrain. The slope of the terrain at a given point is defined by a low resolution normal map. My first attempt at this reduced the frame rate on the XBOX from about 100fps to 70fps. Linear algebra comes in handy when optimizing something like this. By manually reducing the operations required to build the rotation matrix used in the shader to rotate the normals into place, I was able to gain back 10fps.
So this runs at 80fps on the XBOX, and dips down to 60 FPS when I get lots of particles going. There’s still plenty of room for optimization if needed, but I’ll be focusing on getting the gameplay done first.