Seams showing on my cubemaps

Sage
Posts: 1,199
Joined: 2004.10
Post: #1
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]

[Image: 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.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #2
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);

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #3
That did the trick -- thanks!
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
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...
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #5
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  showing off new space game gooncorp 1 3,245 Nov 8, 2012 02:35 PM
Last Post: PythonBlue
  Nothing showing up in NSOpenGLView [newb] binaryinsomnia 6 6,507 Nov 29, 2011 07:04 PM
Last Post: binaryinsomnia
  Best strategy for rendering into cubemaps? TomorrowPlusX 7 4,882 Dec 6, 2009 11:53 AM
Last Post: TomorrowPlusX
  cubemaps with shaders akb825 3 3,207 Apr 5, 2006 06:24 PM
Last Post: akb825
  Automatic cubemaps via PBuffers TomorrowPlusX 20 8,864 Feb 15, 2006 07:21 AM
Last Post: TomorrowPlusX