Thank you! ASAP I'll try it and I'll let you know :)
Christian
---------------------------------------------
I'm attaching a quick hack that makes the test case I have work. Before I
clean it up and implement it properly would you mind giving it a try to see
if it works for you as well? Thanks!
There is one remaining issue I'm aware of:
The viewport with shadows needs a SolidBackground with alpha == 0.f
when shadows
are enabled and a DepthClearBackground when shadows are disabled. I'm not
sure how to get around that right now.
Cheers,
Carsten
On Fri, Mar 15, 2013 at 5:11 PM, Christian Bar <christ...@gmail.com> wrote:
> Thank you for your answer :)
> No, I have to render the other viewport first...
> The solution shoul be exactly what you are proposing:
> teaching the ShadowStage to not touch pixels not
> written to by the scene it renders.
> Hope it is not too complicated...
> In any case, Thank you :)
>
> Christian
>
>
>
> ------------------------------------------------------------------------------------
> Hello Christian,
>
>
> On 03/15/2013 04:54 AM, Christian Bar wrote:
> > Firstly I call window->addPort( viewport_2 ), then window->addPort(
> > viewport_1 ) (misleading viewort names, maybe :) ),
> >
> > so the rendering order should be the one I told you (as the rendering
> > without shadows demonstrates me).
>
> ah, ok :)
>
>
> > The problem shows only when I activate the ShadowStage...
>
> yes, the ShadowStage works sort of like a post-processing effect that
> redraws the whole viewport. I'll have to investigate the implementation
> to see how difficult it would be to teach it not to touch pixels not
> written to by the scene it renders. I'll look into it.
> I'm assuming rendering the shadowed scene first is not an option for
> you, right?
>
> Cheers,
> Carsten
>
>
>
> On Fri, Mar 15, 2013 at 10:54 AM, Christian Bar <ch....@tiscali.it> wrote:
>
>> Firstly I call window->addPort( viewport_2 ), then window->addPort(
>> viewport_1 ) (misleading viewort names, maybe :) ),
>>
>> so the rendering order should be the one I told you (as the rendering
>> without shadows demonstrates me).
>>
>> The problem shows only when I activate the ShadowStage...
>>
>> Thanks,
>>
>> Christian
>>
>>
>> ---------------------------------------------------------------------------------
>>
>> Carsten
>> Neumann<http://www.mail-archive.com/search?l=opensg-users@lists.sourceforge.net&q=from:%22Carsten+Neumann%22>
>> Thu, 14 Mar 2013 16:34:09
>> -0700<http://www.mail-archive.com/search?l=opensg-users@lists.sourceforge.net&q=date:20130314>
>>
>> Hello Christian,
>>
>> thanks for the updated problem description!
>>
>> On 03/14/2013 09:45 AM, Christian Bar wrote:
>> > I have one window. In this window I render two viewports, fully overlapping
>> > inside the window.
>> > Each viewport renders a different scenegraph. Let's call 'viewport_1' and
>> > 'viewport_2' the two viewports.
>> >
>> > - viewport_1 begins with a Node containing a ShadowStage and has a
>> > DepthClearBackground
>> > - viewport_2 has no shadows and a GradientBackground
>> >
>> > When I call window->render(), I expect that:
>> > - GradientBackground is rendered,
>> > - viewport_2 scenegraph content is rendered,
>> > - DepthClearBackground clears the depth buffer (not the frame buffer)
>> > - viewport_1 is rendered (also with shadows)
>>
>> hmm, viewports are rendered in the order they are stored in the window,
>> so viewport_1 should be first, then viewport_2.
>>
>> > What I see inside the window is only viewport_1 content, without a
>> > background
>> > (as if there were none, the framebuffer is not cleared).
>> > This behaviour happens with every shadow mode.
>>
>> Given the render order above, my expectation would be that you only see
>> the content of viewport_2 - something seems to go wrong though.
>>
>> > When I disable shadows, I see that everything works as expected.
>> > Maybe it's useful for you to know that if I change the window size, the
>> > framebuffer is cleared (with a black color).
>>
>> I think you'll have to put the GradientBackground on viewport_1 and the
>> DepthClearBackground on viewport_2.
>> Under normal circumstances (i.e. I suspect a bug is preventing this from
>> working right now) this should give you the desired result. I'm looking
>> into it.
>>
>> 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
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users