Hi Luca,

I'm working with the average value, I've found some problems, just like you. For me the two problems are : - for each new mipmap level, where you have to perform the mean of the four pixels of the previous level, the mipmap_shader use values of the first mipmap level of the texture, and not the log10 values of the previous mipmap level
- the value of the last mipmap level is wrong.

The way I found is :
1. compute the log10 values of the entire texture in a first shader
2. then perform the mipmap with:
osgPPU::UnitInMipmapOut* sceneLuminance = new osgPPU::UnitInMipmapOut();
            sceneLuminance->setName("ComputeSceneLuminance");
            {
                sceneLuminance->generateMipmapForInputTexture(0);
            }
3. get the 5th or 6th level of the mipmapped texture, and perform the mean of this texture in a shader. You'll got your average luminance.

Hope this helps,
Josselin.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to