Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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 1290 times)
0 Members and 1 Guest are viewing this topic.
Offline QuicK

Junior Member





« 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
« 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

Junior Member





« 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!
Legends of Yore - The Casual Retro Roguelike
Offline StrideColossus
« 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

Junior Member





« 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

Junior Member





« 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  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

pw (16 views)
2014-07-24 01:59:36

Riven (16 views)
2014-07-23 21:16:32

Riven (14 views)
2014-07-23 21:07:15

Riven (16 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!