Hi Stefano,
[EMAIL PROTECTED] wrote:
> I'll try to be a little less mysterious (and probably more annoying) to let
> you
> help me better :P
> What I need is to render a scene into RGBE format. It all works fine until I
> have to render models with an alpha < 1.0. Obviously the default pipeline
> cannot
> handle blending in rgbe format, so I have to do it myself.
> My plan was to sort the nodes with setSortTrans(true), render all opaque
> geometry and then, for each transparent node present on the scene, copy the
> current fbo color texture and pass it to a shader able to perform the RGBE
> blending operation between the new geometry fragments and the underlying
> pixels.
> I tried to use the registerEnterFunction() and registerLeaveFunction() to be
> able to copy the color attachment texture just in the middle of the rendering,
> but it seems it doesn't work as it should.
>
[SNIP]
>
> What I'd expect is to see is the scene composing little by little. The first
> geometry, then the first geometry + the second one, and so on.. Instead, what
> I'm getting is a number of identical empty steps that just show the viewport
> background, and then the scene completely rendered in the end.
>
> What am I doing wrong?!
maybe you are aware of this, but just to avoid confusion: the enter
callbacks are called when the depth first traversal of the scenegraph
hits a node on its "descent" while the leave callback is called after
all children have been visited.
Your scene does not build up gradually, because it is not rendered in
immediate mode. Instead the renderaction builds a tree where geometry is
sorted by transparency/non-transparency and then by material so that
geometry with identical material is drawn at once.
Since you want to hook into the actual rendering you need to look into
what the renderActionHandler and drawPrimitives functions of
MaterialDrawable and derived classes do.
Offhand I don't know if the available machinery is flexible enough to
allow you to do what you are after, maybe somebody who has been working
on the RenderingAction lately can comment on that please ?
Hope it helps,
Carsten
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users