Am 26.09.2012 17:27, schrieb Kenzo Lespagnol:
Hi Sebastian,
I've followed your advice, but I've still the issue. So it's seems I'm using a
wrong way to generate my mipmaps. Is hardware mipmap generation actually
average the values between the different mipmap levels?
More or less. I don't know the exact wording from the specification, but
the mipmapping should actually do a bilinear interpolation for 4
neighbouring texels per mip level. I've found many examples that used
the last LOD for average lum.
Code:
logAveragedLumTexture->setUseHardwareMipMapGeneration(true);
logAveragedLumTexture->allocateMipmapLevels();
osg::ref_ptr<osg::Texture2D> tex2D =
dynamic_cast<osg::Texture2D*>(logAveragedLumTexture.get());
tex2D->setNumMipmapLevels(numMipMap);
tex2D->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_NEAREST);
That looks okay. I suppose you are using FrameBuffer Objects and this
the setup code for the texture.
About the last parameter, I've checked the OpenGL specifications and I'm
understanding that the last parameter will correspond to the lod level if no
bias is given. See section 8.14.1, formula (8.4), (8.5) and (8.6).
Okay, but the last mip levels number is dependent on the texture
resolution.
Have you simply tried the 1000.0 (it is clamped to the last level)?
Also: as you put the log of the luminance into the texture, you must
uncompress it afterwards (i.e. pow) to get the average in linear space.
Can you maybe provide a screenshot of your artifacts?
Thank you!
Kenzo
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50315#50315
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org