Thursday, February 14, 2013

Forward Rendering and Transparency

After quite a lot of work into the wee hours last night I now have the Forward Rendering pipeline set up.  When an entity is created it can be given a RenderBehavior of Full, DeferredOnly or ForwardOnly.

'Full' entities are rendered via the Deferred rendering step.  They are also active in the Forward rendering step, but the entities themselves are not drawn, just (if activated) associated primitives such as bounding boxes, debug info, etc.

DeferredOnly entities are rendered via the Deferred step, and completely excluded from the Forward step.  Vice versa, ForwardOnly entities are rendered via the Forward step and completely ignored during Deferred processing.

The is one complication I do need to deal with:  an entity that is party transparent, but has non-transparent parts needs to render in both the Deferred (non-transparent parts) and Forward (only the transparent parts). I need to sort that out properly.

Cloud layer is transparent and Forward rendered.

2 comments:

  1. I should do this for my own project eventually. Not just forward rendering (in addition to deferred) but applying it per entity instead of per scene, because my engine doesn't have that flexibility yet. Deferred rendered objects get "flattened" to a render texture, so how do you handle the depth sorting with forward rendered objects? Do you depth compare those objects with the depth render created in the G Buffer pass?

    ReplyDelete
  2. Never mind, it looks like your Restoring Depth article is exactly what I was looking for!

    ReplyDelete