It’s been a while since I did a status update. I spend a week or so working on the wind animations as per some of the previous posts, but I’m working on other things now that that is in decent shape.
Some of the things I did while doing the wind animations:
- Found some nice tropical plant models, and added vertex colors (for wind animation) to them in Blender
- Wrote a ModelProcessor custom content pipeline extension that prepares models to be “wind animated”. One of the things it does is combine three separate color vertex channels, as Blender has no way to paint only to an individual R, G or B component of a color channel. So I instead create 3 color channels in Blender and paint to each individually. In the ModelProcessor they are combined. The ModelProcessor also lets you defined which mesh in a model is a trunk and which is leaves. The cull mode is chosen differently for leaves.
- Related to the cull mode, I made it so the rendering engine takes cull mode into account when determining the draw order of objects. This reduces state changes while drawing.
- I found a script for Blender that performs a rought Ambient Occlusion calculation and puts the result in a vertex color (mentioned in a previous post).
- The normal in my G-buffer was a world space normal. Given that I’m storing it in two 1-byte components using a spheremap transform, this was producing some very noticeable precision artifacts. I switched to using view-space normal, which I was supposed to all along (this requires a few extra shader instructions though).
- Enabled the time-of-day changing. This produced horrible shadow shimmering, which I made a post about. I also spent a lot of time debugging an issue where the sampler states weren’t properly set during the shadow map rendering pass.
- I changed the shadow map from HalfVector2 to Color. I did this so I could enable/disable ColorWriteChannels (which is not permitted for floating point render targets in XNA) so that I could support writing two separate shadow maps in one render target. I now store the depth in the R and G (or B and A) channels.
There was a bunch of other side, but the above is what I happened to think to write down :-).
Right now I have moved focus to developing the entity management system so I can actually start putting together something playable. This involves support for:
- “Seamless” activation/deactivation of objects as you move through the world (since this is an open world)
- Organization of the overall game state
- Support for persisting the minimal set of data needed for save games
This is fairly challenging stuff. I gained some insight with a prototype I made a long time ago using basic 2d graphics – but which supported an object system and included some fairly advanced things such as NPCs that could engage in conversation and follow schedules over the course of the day. Splitting the game world into static data, persisted data and “transient” data was a challenge, and my solutions back then were weak at best. Just for kicks, here is a screenshot of that prototype in action:
This time I’m designing from the ground up to make that all as seamless as possible, so we’ll see how it turns out.
It’s likely for the next few weeks I’ll have less interesting things to show (visually), since more work will be done behind the scenes.