[FIXED]Skybox Rendering

So…I’ve got a working skybox and I’m trying to figure out how I can make it better/more realistic.

In the following screenshot, you can see that there are dark lines where the planes intersect.

http://bit.ly/UuedEN

I’ve made sure that the images themselves do not have any such lines.

Some information on how the skybox is rendered:

The FloatBuffer data fed to openGL:

http://pastebin.java-gaming.org/551a80d3e4a

The rendering method:

http://pastebin.java-gaming.org/51a8d1e3a43

Also, I know that a new trend in games is to have a spherical skybox. Should I ditch the old cube-style?

Thanks,
QuicK

Couple of possibilities:

  1. Assuming you are using a cube-map texture for your skybox (i.e. six separate texture images) how did you break-up the skybox image into the separate parts? If you did it manually those lines might just be artifacts in the images themselves.

  2. Did you use CLAMP_TO_EDGE as your wrapping policy?

  3. Do you see the same artifacts on every edge, or just the three in the picture you posted?

  • stride
  1. It was done on the pixel-by-pixel level in Adobe Photoshop CS5

  2. No. I’ll research this. If its simple to explain, feel free to explain it on this topic :smiley:

  3. Yes they’re on every edge, it’s probably the wrapping policy that will fix it.

How would I go about separating the skybox image via an algorithm? PNG decoder?

I did the same thing and had the same artifacts that you’re seeing, it’s quite hard to chop up an image by hand.

Here’s some cut-and-paste pseudo-code code from texture loader class used by my skybox builder (using LWJGL):


...
final int type = GL_TEXTURE_CUBE_MAP;
allocate texture cube-map
upload the 6 texture images
...
// Set wrapping config
final int wrap = GL12.GL_CLAMP_TO_EDGE
glTexParameteri( type, GL_TEXTURE_WRAP_R, wrap );
glTexParameteri( type, GL_TEXTURE_WRAP_T, wrap );
glTexParameteri( type, GL_TEXTURE_WRAP_S, wrap );
...
apply min/mag filters
...

Dunno, anyone else have any advice on how to separate the 6 texture images?

Ahh thanks!

Im not near my computer atm but ive got one question about that code. Is it a one-time binding? Or do I need to do this every render tick?

Itll be nearly 24 hours before I can test this but ill let you know if it works! :smiley:

Really appreciate the feedback!
(LOVE this forum! And the community)

The parameter will be attached to the named texture (i.e. the “handle” from glGenTextures). More info here.

Thank you guys! :smiley:

I’ve had to re-write how I load in textures, but it was worth it! It’s working perfectly now :slight_smile: