Thanks Robert,

Rendering to texture is ok, it works fine.
What I need is to completely split the rendering (pre and others) in 2
very own calls (or find a way to do the same)
To explain the context / my need, here is a little documented 'code' :


myOwn3DEngine* aCustom3DEngine;
osgViewer* myViewer;

//init the osg world, add a osg shadowedScene (with
osgShadow::ShadowMap technique)
[...]

//init my own world (aside osg one)
[...]


//in the application loop:

// do all osg render to textures (including shadow map generating)
myViewer->prerenderingTraversals(); // <---- I miss this one :)

// play with generated textures (like adding shadow of non osg objects
in shadow maps)
myOwn3DEngine->updateOsgShadowMaps();

// draw my custom 3d engine, with shared shadow map (shadow maps will
include osg shadows)
myOwn3DEngine->render();

//draw the OSG scene with updated textures (excluding prerendering
stages, as they are done few lines above)
myViewer->renderingTraversals();


=> is there any method to do something like that ?
if I call twice the current renderingTraversals(), textures (including
shadow maps) will be overwritten at each ?
node switch in the graph to enable/disable the rtt camera ? (seems ugly to me)



Fred




On Mon, Oct 19, 2009 at 9:43 PM, Robert Osfield
<[email protected]> wrote:
> Hi Frederic,
>
> Are you familiar with the osgViewer/osg::Camera RTT capabilities?
> They are very flexible now, you can render subgraphs under an scene
> graph RTT osg::Camera as a pre rendering stage then switch it off for
> subsequent frames.   Have a look at the osgprerender,
> osgprerendercubemap examples as well as osgShadow itself.
>
> Robert.
>
> On Mon, Oct 19, 2009 at 7:52 PM, Frederic Marmond <[email protected]> wrote:
>> Hi all,
>>
>> I would like to generate a shadow map before the real scene draw, in
>> order to alter it (add 3rd parties objects shadows in it) before
>> applying the shadow map to the 'real' world.
>> The context is that osg is called inside a custom 3D engine, so a post
>> prerender callback won't be enough.
>>
>> How should I achieve that ?
>> is there a way to do only pre-render stages, then others ?
>>
>> thanks in advance
>>
>> Fred
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to