Monday, August 26, 2013

Rendering Layers

Sick day - still fighting whatever it is I caught last week.  Still, no rest for the sick-ed.

So, what did I do today?
Integrating HUD rendering into the component/camera architecture:
  • There are a set of "layers" that can be rendered to (default, alpha-blend, HUD, etc.)
  • Each game object has a layer mask, that specifies which layers it wants to render to
  • Each component adds its layer mask (if any) to the parent game object's mask
  • Each camera has a set of layers that it draws
  • The camera broadcasts Render(layer) to each component in each game object for each of the camera's draw layers
  • It's the responsibility of each component to decide what (if anything) it wants to draw on each layer
Basically, this arrangement lets me draw the same game object multiple times and let it render its own HUD display.  I have kind of been slacking on enforcing the points in bold, so going back to patch up some components so they don't draw on the wrong layers.

All of this was to try and get the Health component to display a health bar above whatever it's attached to.  Still working on that.
Also, fixed bugs:
  • Engine exhaust particles bound at model space transform, not world space - now that I can get the model-space transform after Friday's model fix
 Oh, and sometime over the weekend, I managed to get the swarm enemy to fire at my ship, which is totally awesome.  :)


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.