This is going to be based on the earlier reflection test from a while back, but with the slightly different perspective. It's also going to be more tricky as it's got to intergrate with the rest of the drawing rather than just a simple few hardcoded sprites. Rendering in Snowman Village is surprisingly complicated, and is based around several core geometry types:
- Sprites are what you'd expect, an image mapped to a quad, with rotation and scaling.
- Rings, which take a texture and map it along a tri strip forming a ring donut shape. Three of these (carefully layered) make up a single snowball (an extra forth ring provides the highlight).
- Beveled rectangles. These split a texture into a 3x3 grid, then stretch it over a rectangle. Corners are kept unscaled, edges stretch along their axis, and the center scales to fit the remainder. Mostly used on the buttons for variable sized rects with nice consistant edges.
- Textured lines. These use the same method as the beveled rects, but with a 1x3 grid division. These get used for the force arrows in the game.
All these are complicated further because the images aren't textures, but a subsection inside a texture atlas. This means that I've got to be careful with the texture coords to stop one image bleeding into another.
Unlike the basic 2d reflection from before, I can't just use the same sprites and flip the texture to create the reflection, due to the slanty top down perspective. Instead I need to create specific reflection geometry and position and layer them to create the correct effect. At the moment they get drawn to a separate texture, then blended over the top after surface details. Most of the work today has been setting this up correctly.
Now I've got the reflection in a texture I can start applying some pixel shaders to it for blur and colour tinting. I'll probably also strech a big texture over the whole village to get a varying reflectivitiy and add a bit more variety.