Seams showing on my cubemaps
Following a recomendation from Nicholas Francis in my "Making Trees" thread, I've transitioned from spheremaps to cubemaps to make my water look specular and shiny and all that.
Trouble is, my cubemaps show seams where the edges join. Attached are a couple screenshots showing what I'm talking about ( it's a little subtle in a screenshot but very obvious when "live" ).
![[Image: Screenshots-2005-12-14-03.png]](http://zakariya.net/shamyl/Water/Screenshots-2005-12-14-03.png)
![[Image: Screenshots-2005-12-14-05.png]](http://zakariya.net/shamyl/Water/Screenshots-2005-12-14-05.png)
In both shots you can see a zigzagging grey line in the water going roughly from top to bottom.
I know that my actual cubemap images tile, because they're very simple. I'm using add-signed blending so the cubemaps are just middle grey ( 128 ) with gradients to emphasize global lighting.
Initially I figured it was a mipmapping issue, but I see the problem regardless of wether I load mipmaps for the cubemap.
Trouble is, my cubemaps show seams where the edges join. Attached are a couple screenshots showing what I'm talking about ( it's a little subtle in a screenshot but very obvious when "live" ).
![[Image: Screenshots-2005-12-14-03.png]](http://zakariya.net/shamyl/Water/Screenshots-2005-12-14-03.png)
![[Image: Screenshots-2005-12-14-05.png]](http://zakariya.net/shamyl/Water/Screenshots-2005-12-14-05.png)
In both shots you can see a zigzagging grey line in the water going roughly from top to bottom.
I know that my actual cubemap images tile, because they're very simple. I'm using add-signed blending so the cubemaps are just middle grey ( 128 ) with gradients to emphasize global lighting.
Initially I figured it was a mipmapping issue, but I see the problem regardless of wether I load mipmaps for the cubemap.
You most likely need to turn on clamp-to-edge for the offending textures:
Code:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
That did the trick -- thanks!
CLAMP_TO_EDGE fixes mipmap 0, but at smaller levels, if you used regular gluBuild2DMipmaps, it's likely that the averaging will still cause visible seams at the edges.
Depending on the size of the cubemap, this may be very minor. But to be absolutely seamless you'd want to compute the edge texels of each face averaged with the edge of an adjacent face. In a perfect world, you'd just submit textures with borders and the hardware would do this at sample time, but no consumer hardware currently supports border texels.
ATI has a nice writeup (and Windows tool) for solving exactly this problem with smarter filtering. Worth reading...
Depending on the size of the cubemap, this may be very minor. But to be absolutely seamless you'd want to compute the edge texels of each face averaged with the edge of an adjacent face. In a perfect world, you'd just submit textures with borders and the hardware would do this at sample time, but no consumer hardware currently supports border texels.
ATI has a nice writeup (and Windows tool) for solving exactly this problem with smarter filtering. Worth reading...
That's really quite interesting -- I'd love to have such a tool for OS X ( since I don't even *have* a PC ). Oh well.
Regardless, it's interesting to see the discussion of using the 4x4 mipmap level for burnished metal/lighting effects. I'm going to have to look into that.
Regardless, it's interesting to see the discussion of using the 4x4 mipmap level for burnished metal/lighting effects. I'm going to have to look into that.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| showing off new space game | gooncorp | 1 | 1,992 |
Nov 8, 2012 02:35 PM Last Post: PythonBlue |
|
| Nothing showing up in NSOpenGLView [newb] | binaryinsomnia | 6 | 4,990 |
Nov 29, 2011 07:04 PM Last Post: binaryinsomnia |
|
| Best strategy for rendering into cubemaps? | TomorrowPlusX | 7 | 4,112 |
Dec 6, 2009 11:53 AM Last Post: TomorrowPlusX |
|
| cubemaps with shaders | akb825 | 3 | 2,799 |
Apr 5, 2006 06:24 PM Last Post: akb825 |
|
| Automatic cubemaps via PBuffers | TomorrowPlusX | 20 | 8,085 |
Feb 15, 2006 07:21 AM Last Post: TomorrowPlusX |
|

