Hi, I've managed to generate my mipmap via the hardware. But I'm guessing I don't have the good mipmap as the result of my tone mapping is unstable. The screen is brighter in a jerky manner for some position of the camera.
As below, how to create my mipmap: Code: osg::ref_ptr<osg::Texture2D> tex2D = dynamic_cast<osg::Texture2D*>(logAveragedLumTexture.get()); tex2D->setNumMipmapLevels(9); tex2D->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); tex2D->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR); Then I'm retrieving the values of the smallest mipmap (2x2), by accessing to the LOD level 9 as my texture is 512 by 512 as the beginning: Code: // get last mipmap level as 2x2 texture vec4 lastMipmapLevel; lastMipmapLevel.x = textureLod(logAveragedLumTexture, vec2(0.25, 0.25), 9.0).r; lastMipmapLevel.y = textureLod(logAveragedLumTexture, vec2(0.75, 0.25), 9.0).r; lastMipmapLevel.z = textureLod(logAveragedLumTexture, vec2(0.25, 0.75), 9.0).r; lastMipmapLevel.w = textureLod(logAveragedLumTexture, vec2(0.75, 0.75), 9.0).r; I'm not sure about the way to access to my mipmap. I've tried other texture coordinates but the results is still unstable. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50295#50295 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

