Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (8 posts)

SunBurn and occluded/obstructed lights and shadows

Last post 1/31/2011 8:32 PM by Synapse Gaming LLC. 7 replies.
  • 1/26/2011 1:45 AM

    SunBurn and occluded/obstructed lights and shadows

    What ho,

    I'm rather impressed with the demonstration videos of the SunBurn engine I've seen. Can anyone tell me whether SunBurn's lighting automatically takes into account parts of the level and intervening objects which would obstruct a light source, partly or entirely? An example would be a level with two parallel corridors separated by a wall, with a large radius point light in one of them and the camera in the other. The scene should be dark (there's a wall in the way of the light), but vanilla XNA shader code would render both corridors as lit as far as the point light range extends.

    One might argue that I'm asking about shadows rather than lighting, and I suspect that may be true, but I thought I'd best ask the question this way around just in case.

    With respect to shadows cast by objects, what are the practical limits on such when using SunBurn's deferred rendering, especially per light? I'd like to use SunBurn with deferred lighting to render a cluttered indoor level with a few dozen lights in various rooms and corridors, all casting appropriate shadows and obeying intervening walls and the like. I'm wondering whether it can do this sort of thing out of the box or if competence is required to make it so and engage.

    Thanks and all the best,
        -eg.
  • 1/26/2011 3:12 AM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    I'm not specifically an expert in Sunburn, but what you're talking about is generally applicable to 3d rendering.  It is indeed shadows that you're looking for.  Sunburn is very good at rendering shadows, but there are limits to even the best shadow mapping setup.

    Rendering a scene with dozens of shadow casting point lights all visible at once is going to cause you some problems.  At the very minimum, a point light is going to require 2 shadow map passes and 2 shadow map rendertargets.  Let's say you want a dozen of them.  That's 24 shadow draw passes and 24 extra shadow rendertargets, plus your main rendering pass.  Even with aggressive culling, most engines can't survive drawing the scene 25 times, just on the sheer basis of draw call count.  Furthermore, if you want a decent shadow resolution without being jagged, you're going to probably want at least 512x512 targets.  That's 24 megabytes of extra rendertarget memory, and at 720p, 6 full screens of additional fill rate.

    That's why most commercial games don't have many shadow-casting lights.
  • 1/26/2011 4:15 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    Unless you are using the SunBurn deferred renderer which can handle such configuration better than forward renderer and with way less overhead ;)
    If I remember correctly, deferred rendering will use a sphere to define point light lighting and render it in a lighting pass.
  • 1/26/2011 4:53 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    I suggest having a look in the SunBurn forums.  Some useful stuff there.

    Here's just one post I found quickly on the number of renders used per shadow:
    http://www.synapsegaming.com/forums/t/274.aspx
  • 1/26/2011 5:03 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    Philippe Da Silva:
    Unless you are using the SunBurn deferred renderer which can handle such configuration better than forward renderer and with way less overhead ;)
    If I remember correctly, deferred rendering will use a sphere to define point light lighting and render it in a lighting pass.


    Yes, that is how deferred rendering works.  It still doesn't save you from needing to render the shadow maps for each shadow-casting light.  Sure, you don't have to render the whole scene - you only have to render what's inside the sphere - but even that has its limits.
  • 1/26/2011 8:05 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    Hi guys,

    SunBurn supports both occlusion querying and view culling to render (and calculate shadows for) only the lights that are visible on-screen.  This allows you to have a large number of shadow casting lights, as long as the number on-screen at a time is reasonable.

    You can also mix in a large number of non shadow casting fill lights for effects like light bouncing, highlighting places of interest / items, and more.

    SunBurn stores multiple shadow maps per render target and supports shadow map level-of-detail, which reduces memory usage and rendering overhead considerably.  Many scenes will use a single render target, and more complex scenes often peak at two targets.

    You can also specify the maximum amount of memory shadows are allowed to use and the system will automatically reduce the shadow resolution when necessary to fit.

    Let me know if this helps!
  • 1/27/2011 9:49 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    It does indeed, thanks. In fact I've purchased Sunburn Pro on this basis. A day of wrangling later and I've more or less switched my work in progress over to using it, though I've plenty of optimisation to do now :) The lighting and shadows seem very good indeed.

    Thanks for the help, and all the best,
        -eg.
  • 1/31/2011 8:32 PM In reply to

    Re: SunBurn and occluded/obstructed lights and shadows

    Hi Ego,

    Awesome, welcome to the SunBurn community!  If you have any questions along the way just ask.

    And feel free to show off your latest work in the forums.

Page 1 of 1 (8 posts) Previous Discussion Next Discussion