Friday, November 19, 2010

Optimization

I tried a couple things with regards to shaders since the last post:
1. I attempted to make the violence of waves decrease with depth, by passing the heightmap to the shader. Unfortunately, this both slowed it down and allowed the low resolution of the reflection to show through in shallow water. I therefore consider this a failure.
2. I created a new version of the texture atlas shader, this time allowing for smooth alpha transitions between tiles. It unfortunately contains a few more 2Dtex lookups than the less-detailed one (putting it on par in speed with the splatting shader), but the effect is so much nicer I can't fault it. All I need now are truly irregular tile shapes... not quite sure how to start on that aside from messing with the noise sampler that drives the small irregularities already present.

The final thing I added is a "compositor" - a full-screen shader to adjust colors and other fancy effects. It does a number of useful things:
1. Dark colors have a sepia-effect applied to them, turning them slightly brown. This does not compromise their value, though - just their saturation and hue.
2. Bright colors are brightened, but not overly much.
The above serve to add contrast to the scene, bringing out color elements that would otherwise be obscured.

And finally, I have support for a "bloom effect" of sorts. At present, it is spreading white pixels around to their neighbors, creating a visually-pleasing "sparkle" effect on water. I need to figure out a way to do cheap, limited "bloom," however, as that would be better for my purposes. Also, the current effect requires four texture lookups - a potentially ruinous amount.

All detail objects have been textured. Now I need to put the system together into a regional forest system, defining bands of temperature, elevation, and fertility where plant types can occur.

The plan for steps following this is as follows:
* Front end, EG main menu - because I like designing them, and this feels like a good time.
* Options program (external to the main program) to adjust settings. It's essential to include this early so I can consolidate these options and work them into later features.

No comments:

Post a Comment