[osg-users] why the "adaptedlum->addChild(brightpass)" code is doing what it does In the osgPPU hdr example

Mirro Xu mirro187 at gmail.com
Thu Oct 24 05:45:43 PDT 2019


Hi,

            // The adapted luminance ppu do compute it. However if you
            // can follow me for now, you maybe encounter, that this ppu do
            // have to write into the same texture as it also read from.
            // To prevent this, we just generate an inout ppu which do
            // nothing than render the copy of input to the output.
            // We will use the output of this ppu as input for the
            // adapted luminance ppu. In this way we do not write to the
            // same texture as we have readed from.
            osgPPU::UnitInOut* adaptedlumCopy = new osgPPU::UnitInOut();
            adaptedlumCopy->setName("AdaptedLuminanceCopy");
            adaptedlumCopy->addChild(adaptedlum);

            // now connect the output of the adaptedlum with the rest where it is needed
            adaptedlum->addChild(adaptedlumCopy);

            adaptedlum->addChild(brightpass);
            brightpass->setInputToUniform(adaptedlum, "texAdaptedLuminance");

            adaptedlum->addChild(hdr);
            hdr->setInputToUniform(adaptedlum, "texAdaptedLuminance");

Thank you!

Cheers,
Mirro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76854#76854







More information about the osg-users mailing list