[osg-users] [osgPPU] osgPPU HDR problem with cycles
art at tevs.eu
Thu Nov 5 07:32:14 PST 2009
sorry, it seems I had some permission problems on the forum, so that
your post get removed somehow. So to your question:
> In this example, you are using a cycle dependancy (between adaptedLuminance and adaptedLuminance child) to get the previous frame average luminance scene.
> When I use your application, it works well.
> But in my application, I have got stack overflow assert in the recursiv osg function group::SetThreadSafeRefUnref(...) because (I guess) it is looping on the cycle without any chance of exit
> void Group::setThreadSafeRefUnref(bool threadSafe)
> for(NodeList::const_iterator itr=_children.begin();
> I did deeply have a look on your sample but I do not understand why it is working in your example ...
> What did I forget ?
Yes, in deed, I am using cycle dependency. This is per default not
supported in osg. However, I've have written my own visitor which
looks for cycles and replaces them with special BarrierNode. This node
makes sure, that cycles are resolved.
In order to solve that issue for your application, you can add a
BarrierNode manually, between the both cycled frames. The same war as
osgPPU::ResolveCyclesVisitor (look into Visitor.h) will do it. This
You could also think on changing the unit graph to remove cycle
dependency. This can be achieved with using UnitTexture and specifying
the output texture of adaptedLuminance as input texture for it.
However, with this solution, your luminance values will be one frame
behind the actual luminance. For the HDR example this might be not
problematic, however for the motion-blur example, this could produce
artifacts when moving the camera. (I am using cycle dependency also in
motion blur example).
More information about the osg-users