OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

[CubeMap with mipmaps] About loading IBL


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 426
Location: France

PostPosted: Sat Nov 04, 2017 12:37 am    Post subject:
[CubeMap with mipmaps] About loading IBL
Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 426
Location: France

PostPosted: Sat Nov 04, 2017 2:54 am    Post subject:
Re: [CubeMap with mipmaps] About loading IBL
Reply with quote

Yes there's definetly something wrong with cubemaptexture upload..I'll give details tomorrow...
Don't hesitate to give direction if you had any experience with lod cubemap


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
Back to top
View user's profile Send private message Visit poster's website
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 426
Location: France

PostPosted: Sat Nov 04, 2017 3:34 pm    Post subject:
Re: [CubeMap with mipmaps] About loading IBL
Reply with quote

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.

From OpenGL Common Mistakes:
Again, if you use more than one mipmaps, you should change the GL_TEXTURE_MAX_LEVEL to state how many you will use (minus 1. The base/max level is a closed range), then perform a glTexImage2D (note the lack of "Sub") for each mipmap.

I made a pr for it...

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]
Back to top
View user's profile Send private message Visit poster's website
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11923

PostPosted: Mon Nov 06, 2017 8:54 am    Post subject:
[CubeMap with mipmaps] About loading IBL
Reply with quote

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:
Quote:
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:
Quote:
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








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
donvito
Newbie


Joined: 23 Jun 2011
Posts: 11

PostPosted: Thu Dec 21, 2017 4:49 pm    Post subject:
Re: [CubeMap with mipmaps] About loading IBL
Reply with quote

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:
Quote:
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:
Quote:
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








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11923

PostPosted: Thu Dec 21, 2017 5:47 pm    Post subject:
[CubeMap with mipmaps] About loading IBL
Reply with quote

On 21 December 2017 at 16:50, Giuseppe Donvito
<> wrote:
Quote:
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.

I did merge a fix from Julien but it did in the end cause a
regression, so the fix "worked" in that it hide the actual problem for
that specific usage case but introduced serious problems with other
usage cases. In the end I had to revert the "fix".

With my investigation into the problem I finally worked out the actual
cause of the bug and have checked in a proper fix. Updating to git
master will resolve this issue.

The fix is:

https://github.com/openscenegraph/OpenSceneGraph/commit/dfec052eb983c10467faeae16c9cb7dca5b45379#diff-91ee382a4d543072ea66aab422e5106f


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts error while loading .iv file in opens... Rj@123 General 0 Wed Jun 20, 2018 10:52 am View latest post
No new posts Support for loading cubemap images in... Farshid Lashkari Submission 7 Wed May 09, 2018 5:56 pm View latest post
No new posts render to a texure bound to an FBO an... Julius Ziegler General 4 Tue Apr 10, 2018 6:49 pm View latest post
No new posts Database pager and failed loading of ... hartwigw General 3 Sun Mar 04, 2018 5:51 pm View latest post
No new posts Database pager and failed loading of ... hartwigw Submission 2 Sun Mar 04, 2018 5:42 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP