Horde3D

Next-Generation Graphics Engine
It is currently 15.10.2019, 12:03

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Broken cubemap mipmaps
PostPosted: 22.04.2011, 20:49 
Offline

Joined: 17.04.2011, 15:13
Posts: 8
Hi,

I noticed a problem generating cubemap mipmaps on OSX. According to http://www.opengl.org/sdk/docs/man3/xht ... Mipmap.xml:

Quote:
GL_INVALID_OPERATION is generated if target is GL_TEXTURE_CUBE_MAP and the texture bound to the GL_TEXTURE_CUBE_MAP target of the active texture unit is not cube complete.


A possible fix:

Code:
Index: Horde3D/Source/Horde3DEngine/egRendererBase.cpp
===================================================================
--- Horde3D/Source/Horde3DEngine/egRendererBase.cpp   (revision 763)
+++ Horde3D/Source/Horde3DEngine/egRendererBase.cpp   (working copy)
@@ -466,12 +466,8 @@
                        inputFormat, inputType, pixels );
    }
 
-   if( tex.genMips )
-   {
-      glEnable( tex.type );  // Workaround for ATI driver bug
+   if( tex.genMips && ( tex.type != GL_TEXTURE_CUBE_MAP || slice == 5 ) )
       glGenerateMipmapEXT( tex.type );
-      glDisable( tex.type );
-   }
 
    glBindTexture( tex.type, 0 );
    if( _texSlots[15].texObj )


Top
 Profile  
Reply with quote  
PostPosted: 25.04.2011, 18:22 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Good finding, thank you!

The patch assumes that the 6th cube face is always uploaded last but that's a reasonable assumption. Unfortunately the ATI workaround can't be removed yet as even recent drivers still seem to have some issues.


Top
 Profile  
Reply with quote  
PostPosted: 26.04.2011, 13:40 
Offline

Joined: 17.04.2011, 15:13
Posts: 8
marciano wrote:
Unfortunately the ATI workaround can't be removed yet as even recent drivers still seem to have some issues.


I do have an ATI and that works for me, but I think Apple uses its own drivers...
In any case, are those issues happening with any texture or just with cubemaps?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group