[osg-users] [CubeMap with mipmaps] About loading IBL

Giuseppe Donvito giuseppe.donvito at gmail.com
Thu Dec 21 08:50:14 PST 2017


Hi Robert and all,
 I totally confirm the bug described by mp3butcher, also in my case I can't use an IBL cubemap with pre-generated mipmaps associated to a texture.
I have to remove mipaps (and at least generate them in hardware) otherwise the IBL channel will result black.
The cubemap is produced by a standard tool.

 Giueppe



robertosfield wrote:
> HI Julien,
> 
> The code is osg/Texture.cpp has been written a long time ago so in
> theory should have been exposed to testing for many years so I am
> surprised the change you have found that works is required, and I'm
> not confident the change you suggest won't break things.  Given how
> long Texture.cpp has been around it sounds like you are using a usage
> case/hardware/driver combination that hasn't been tested out before.
> Given this it could be errant OSG code or a driver issue, if the later
> the workaround could well cause problems elsewhere.  The only way to
> tease this out would be to have a test case that can be tried on
> different systems.
> 
> Unfortunately I don't have any cubemap mipmapped test cases myself,
> could you provide one?
> 
> Robert.
> 
> On 4 November 2017 at 15:34, Julien Valentin <> wrote:
> 
> > Hi all
> > So debugging all the night i notice the problem seams to ome from osg/Texture.cpp line 2303:
> > 
> > 
> > Code:
> > glTexSubImage2D( target, k,
> > 0, 0,
> > width, height,
> > (GLenum)image->getPixelFormat(),
> > (GLenum)image->getDataType(),
> > dataPtr + image->getMipmapOffset(k));
> > 
> > 
> > This code seams not to do its job...Replacing It with
> > 
> > Code:
> > glTexImage2D( target, k, _internalFormat,
> > width, height, _borderWidth,
> > (GLenum)image->getPixelFormat(),
> > (GLenum)image->getDataType(),
> > dataPtr + image->getMipmapOffset(k));
> > 
> > 
> > 
> > seams to make it works.
> > @Robert
> > Is this fix valid enought to make a pr?
> > 
> > Cheers
> > Good WE
> > 
> > 
> > mp3butcher wrote:
> > 
> > > Hi all
> > > 
> > > I'm trying to load an IBL cubemap with lod but once I'm trying to set mipmapdata for log2(pow2size)+1 levels (and so override hardware mipmap generation) the cubemap appears black (even the first level that i actually validated with the autoHWMipMapGeneration(minfilter=miplinear) /: ?! )..
> > > 
> > > Any leads?
> > > 
> > > Thank you!
> > > 
> > > Cheers,
> > > Julien
> > > 
> > [/code]
> > 
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=72305#72305
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


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







More information about the osg-users mailing list