Hello Christian,
On 03/19/2013 10:40 AM, Christian Bar wrote:
> Whoah! It works!
> Thank you.
> Hope you can make it work with the DepthClearBackground also when
> shadows are enabled, but for now... Thanks!
thanks for testing! I'm committing a cleaned up version of it. There is
a new option on the ShadowStage, that you need to enable
(setCombineBlend(true)), this enables blending when writing the combined
scene and shadow images to the framebuffer.
The limitation on having to switch backgrounds when shadows are enabled
remains unfortunately. I'll explain the reason for it, in case someone
has an idea how to resolve it:
The ShadowStage first renders a lit (no shadows) version of the scene
into an FBO (if shadows are enabled, otherwise it simply renders the lit
scene to the target framebuffer). It then creates the shadow maps for
each light source and combines those into a single shadow intensity
image. The two images (lit scene and shadow intensity) are then combined
by multiplying the scene color with the shadow intensity and written to
the target framebuffer.
For the compositing to work the scene image has to be transparent except
where the scene objects are (hence the FBO has to be cleared with a
SolidBackground with alpha == 0).
However, if shadows are disabled there is no scene image, the scene is
rendered directly to the target framebuffer, so no clearing of colour
buffers should happen (i.e. a DepthClearBackground is needed).
One option would be to add a NO_SHADOW_COMPOSE mode that renders the
scene to an FBO and then draws that image into the target framebuffer,
but that seems like overkill. Other ideas?
Cheers,
Carsten
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users