0
\$\begingroup\$

What techniques are used to guarantee rendering order (back to front) when you have more than one deferred context?

My original idea was to manually remap the Command Lists, but it seems like this is not possible.

Do games just render all Alpha objects using the immediate context (to guarantee order)?

Thanks!

\$\endgroup\$
7
  • 1
    \$\begingroup\$ A deferred context is not actually drawn until you execute it on the immediate context, so the order you submit them is going to control draw order. \$\endgroup\$ Commented Apr 5, 2018 at 15:57
  • \$\begingroup\$ @ChuckWalbourn But if you have lets say 2 work threads, and you are pumping assets to each one from back to front order, then each thread will zig-zag the actual order. When it comes time to execute the command list from thread 1, and then thread 2, it wont actually be in order, right? \$\endgroup\$ Commented Apr 5, 2018 at 20:10
  • \$\begingroup\$ You still have the sort merge problem of course. That said, you usually want to render opaque geometry front-to-back (to maximum the efficiency of z-culling), and then render transparent geometry back-to-front (to get correctly blended results) so you are better off doing opaque & transparent in different passes anyhow. \$\endgroup\$ Commented Apr 6, 2018 at 16:32
  • \$\begingroup\$ @ChuckWalbourn Okay! As I thought, there is a underlining issue if you have more than 1 worker thread, even with transparent rendering, it will not 100% be in order since there are multiple worker threads. Is this technical term called "Merge Problem" and is there any solutions to it? Or do you just live with the out of order rendering that will happen. \$\endgroup\$ Commented Apr 10, 2018 at 19:58
  • \$\begingroup\$ To get 'correct' ordering, you always need to have a distinct pass for opaque vs. transparent objects. That or each worker thread produces two deferred contexts: One for opaque and one for transparent. \$\endgroup\$ Commented Apr 10, 2018 at 21:45

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.