Which is the best example?

rated by 0 users
This post has 6 Replies | 4 Followers

Top 200 Contributor
Posts 10
SunBurn_Pro_Licensee
helmers Posted: 08-28-2009 5:58 AM

Hy I am just beginning to adapt my game engine to the Sunburn rendering system. But after having a shallow look over the different samples and the documentation I am a little bit confused.

There seem to be two rendering modes forward and deffered.

From the experiance with my own rendering system I would asume the following:

- foreward is faster but has not the full quality (but shadows seem to work)

- differed has the "dozend of lights" feature but is probably slower

There are the different demos and the "templates". All of them have a different aproach to rendering. Some have their own scene graph, others use one of the internal render managers and so on.

1. So which would be the best example to start from when I want to use the deffered rendering and a quite low level.

2. What is better? Use the high level approach by filling in models into the RenderManager and let it work it's magic. Will the render manager sort the single render calls according to least renderstate/effect changes on the card? Or is it better to use my already working optimizer and pipeline that already breaks models down into "chunks" that are sorted according to best render performance and render them with the Sunburn system (a quite low level approach)?

I would like to get the conversion right on the first time so that I do not have to rewrite my game engine once more.

Any help would be apprechiated. And It would be nice to add some article to the "How To's" about the different approaches. There is nothing about that in the docu and it is quite some work to extract that knowledge out of the class descriptions and the samples.

Thanks in advance,

Helmut

 

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi helmers,

You're correct, SunBurn does support both forward and deferred rendering.  There are some important differences to note in the rendering techniques:


Forward Rendering

  • Pros
    • Slightly better more accurate lighting
    • Faster in simple lighting setups
    • More mature technology
    • Automatic shadows and fog in custom shaders
  • Cons
    • Multiple rendering passes cause additional draw calls and state changes
    • Slower in complex lighting setups

Deferred Rendering

  • Pros
    • Very fast in complex lighting setups
    • Automatic lighting, shadows, materials, and fog in custom shaders
    • Much simpler to write shaders for
    • Target for future features
  • Cons
    • Still in development (API and internals are still evolving)
    • Large memory overhead


I bolded two important points: if you're planning on immediately diving into your game and engine I would probably recommend forward rendering as it's very mature and well established.  However many future features will be utilizing the deferred renderer, so long term deferred is the way to go.

The good news is the renderers are interchangeable (with the exception of custom effects), so much of your engine code that interfaces SunBurn will look and work the same regardless of the rendering technique, allowing you to switch over to deferred down the road.


helmers:
Use the high level approach by filling in models into the RenderManager and let it work it's magic. Will the render manager sort the single render calls according to least renderstate/effect changes on the card?

SunBurn is very aggressive with batching and we put a considerable amount of testing into optimal sorting of rendered objects, so it's probably better to let SunBurn handle rendering as much as possible.  SunBurn's built-in renderers also generate a lot of system statistics, which you can use to see what's going on under-the-hood and to help tune your scenes.

But your engine can still help SunBurn with rendering by providing an additional level of visibility determination, which gives SunBurn a smaller set of objects and lights to work with a ultimately helps improve the overall performance of both the engine and SunBurn.

The Performance Tuning section of the docs includes an interesting article on the performance tweaks we made to the Power Station example and how / why we chose them.  The tweaks outlined are very specific to how we designed the example, but the article shows how knowledge of your scene / engine specific structure can lead to very inexpensive visibility determination optimizations (in some cases determined for-free).


Let me know if this helps and if you have any questions!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 200 Contributor
Posts 10
SunBurn_Pro_Licensee

Thanks for the fast answer!

That was exactly the kind of evaluation info I needed!

So me decision will be to go the deffered and high level way using the PowerStation sample as guideline.

Thanks again for the info.

Top 75 Contributor
Posts 47
SunBurn_Indie_Licensee
SunBurn_Pro_Licensee

I know this is an old post, but I did my due dilligence and used the search feature before asking my questions. So I'll tack onto this post.

My question is simple: I know that transparency is not easily supported using a Deferred render. How does Sunburn handle transparency when working in Deferred mode?

Top 25 Contributor
Posts 197
SunBurn_Community_Licensee
SunBurn_Contributor
SunBurn_Pro_Licensee

Transparency doesn't work easily with deferred rendering and is one of it's major limitations - there are ways of doing limited forms of transparency with deferred rendering but these aren't built into sunburn and my guess is that they'd be fairly difficult to implement without a lot of work - if you're interested look up 'depth peeling' on gamasutra or one of the other game development websites.

You can simulate transparency by rendering transparent objects in a forward pass after sunburns deferred render. An example of this can be seen in the awesome video by duckocide on youtube http://www.youtube.com/watch?v=hoASttN55xA - i'm sure he'd point you in the right direction if you post a comment.

 

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi guys,

bamyazi:
You can simulate transparency by rendering transparent objects in a forward pass after sunburns deferred render. An example of this can be seen in the awesome video by duckocide on youtube http://www.youtube.com/watch?v=hoASttN55xA - i'm sure he'd point you in the right direction if you post a comment.

That's an awesome video. :)

If you render the blended materials outside the render manager (between the calls Render and EndFrameRendering) this thread discusses the technique in detail, and this is the suggested solution (with code borrowed from the Custom Renderer kit to simplify coding).

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 75 Contributor
Posts 47
SunBurn_Indie_Licensee
SunBurn_Pro_Licensee

Hi guys, thanks for the answers. I didn't realize that you could mix Forward and Deferred rendering methods in the same draw. That opens up a world of opportunities for optimization!

Page 1 of 1 (7 items) | RSS