Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [FIXED]Skybox Rendering  (Read 592 times)
0 Members and 1 Guest are viewing this topic.
Offline QuicK

Senior Newbie





« Posted 2013-02-17 12:42:31 »

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.



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
Offline StrideColossus

Senior Member


Medals: 3
Projects: 1



« Reply #1 - Posted 2013-02-17 13:02:59 »

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
Offline QuicK

Senior Newbie





« Reply #2 - Posted 2013-02-17 13:44:36 »

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 Cheesy

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?
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline StrideColossus

Senior Member


Medals: 3
Projects: 1



« Reply #3 - Posted 2013-02-17 15:43:21 »

1) It was done on the pixel-by-pixel level in Adobe Photoshop CS5

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.

Quote
2) No. I'll research this.  If its simple to explain, feel free to explain it on this topic Cheesy

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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
...
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
...


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

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

Senior Newbie





« Reply #4 - Posted 2013-02-17 16:46:25 »

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! Cheesy

Really appreciate the feedback!
(LOVE this forum! And the community)
Offline davedes
« Reply #5 - Posted 2013-02-17 17:55:28 »

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?
The parameter will be attached to the named texture (i.e. the "handle" from glGenTextures). More info here.

Offline QuicK

Senior Newbie





« Reply #6 - Posted 2013-02-19 03:14:52 »

Thank you guys! Cheesy

I've had to re-write how I load in textures, but it was worth it! It's working perfectly now Smiley
Pages: [1]
  ignore  |  Print  
 
 

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (88 views)
2013-05-17 21:29:12

alaslipknot (96 views)
2013-05-16 21:24:48

gouessej (128 views)
2013-05-16 00:53:38

gouessej (123 views)
2013-05-16 00:17:58

theagentd (131 views)
2013-05-15 15:01:13

theagentd (119 views)
2013-05-15 15:00:54

StreetDoggy (161 views)
2013-05-14 15:56:26

kutucuk (184 views)
2013-05-12 17:10:36

kutucuk (185 views)
2013-05-12 15:36:09

UnluckyDevil (191 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 20 queries.