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 (408)
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  
  Realtime 3D sky generation (Online Applet)  (Read 1838 times)
0 Members and 1 Guest are viewing this topic.
Offline DzzD
« Posted 2011-02-11 19:34:17 »

here is a WIP I am working on (with a trainee) to generate sky appearance in real time that we will soon use in our game.

note that it is still a WIP : some problems still appears in rendering and it is not yet fully optimized.

for each frame the Applet generate the five skybox texture, apply them to a skybox & render the frame


http://demo.dzzd.net/Sky/


What you cannot see online :

The current version enable to set a location on earth and a date to generate  the sky with the correct sun location ( it should also soon put the correct clouds coverage of the selected area)

It can also generate the sky reflection map texture ( the one you may apply on reflective object : chrome/sea/etc...)

Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #1 - Posted 2011-02-11 20:41:06 »

I kept adding more clouds and got:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
Exception in thread "AWT-EventQueue-2" java.lang.ArrayIndexOutOfBoundsException: 257
   at SkyFactory.cloud(SkyFactory.java:324)
   at SkyFactory.clouds(SkyFactory.java:293)
   at SkyFactory.color(SkyFactory.java:242)
   at SkyFactory.updateTextureSides(SkyFactory.java:352)
   at SkyFactory.update(SkyFactory.java:539)
   at Sky.updateWorld(Sky.java:128)
   at Sky.keyPressed(Sky.java:268)
   at java.awt.Component.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-2" java.lang.ArrayIndexOutOfBoundsException: 260
   at SkyFactory.cloud(SkyFactory.java:324)
   at SkyFactory.clouds(SkyFactory.java:293)
   at SkyFactory.color(SkyFactory.java:242)
   at SkyFactory.updateTextureSides(SkyFactory.java:352)
   at SkyFactory.update(SkyFactory.java:539)
   at Sky.updateWorld(Sky.java:128)
   at Sky.keyPressed(Sky.java:268)
   at java.awt.Component.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-2" java.lang.ArrayIndexOutOfBoundsException: 270
   at SkyFactory.cloud(SkyFactory.java:324)
   at SkyFactory.clouds(SkyFactory.java:293)
   at SkyFactory.color(SkyFactory.java:242)
   at SkyFactory.updateTextureSides(SkyFactory.java:352)
   at SkyFactory.update(SkyFactory.java:539)
   at Sky.updateWorld(Sky.java:128)
   at Sky.keyPressed(Sky.java:268)
   at java.awt.Component.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "Thread-12" java.lang.ArrayIndexOutOfBoundsException: 270
   at SkyFactory.cloud(SkyFactory.java:324)
   at SkyFactory.clouds(SkyFactory.java:293)
   at SkyFactory.color(SkyFactory.java:242)
   at SkyFactory.updateTextureSides(SkyFactory.java:352)
   at SkyFactory.update(SkyFactory.java:539)
   at Sky.updateWorld(Sky.java:128)
   at Sky.run(Sky.java:157)
   at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-2" java.lang.ArrayIndexOutOfBoundsException: 259
   at SkyFactory.cloud(SkyFactory.java:324)
   at SkyFactory.clouds(SkyFactory.java:293)
   at SkyFactory.color(SkyFactory.java:242)
   at SkyFactory.updateTextureSides(SkyFactory.java:352)
   at SkyFactory.update(SkyFactory.java:539)
   at Sky.updateWorld(Sky.java:128)
   at Sky.keyPressed(Sky.java:268)
   at java.awt.Component.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline DzzD
« Reply #2 - Posted 2011-02-11 20:45:08 »

this is a bug, something that it is not handled ( heu.. do I mention that I was working with a trainee :p ?  you may also notice that the applet is continuously requesting focus )

Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline Addictman

Senior Member


Medals: 3
Projects: 1


Java games rock!


« Reply #3 - Posted 2011-02-11 20:55:13 »

A few glitches in the sky, but still, awesome!
Offline DzzD
« Reply #4 - Posted 2011-02-11 21:05:23 »

A few glitches in the sky, but still, awesome!

theire are still two visibles bugs :
 - mapping on the skybox is not perfect (you can see skybox edge sometimes)
 - some artefact (strange points) appears on clouds  when generating them (I suppose this is because rendering appear while clouds are generated)

Offline Mickelukas

JGO Ninja


Medals: 39
Projects: 2


Java guru wanabee


« Reply #5 - Posted 2011-02-11 21:05:56 »

Really nicely done (except for the glitch and out of bounds Smiley)

Offline DzzD
« Reply #6 - Posted 2011-04-06 19:01:11 »

we've gone further with this project :
 - moon added with real appearance ( phase & path ) based on location & time
 - sea also added

everything is dynamic : cloud cover, sun, moon, sea wave ( and can be rendered in realtime with 3DzzD in software mode )




(online demo ASAP)

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

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 (117 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (216 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.533 seconds with 20 queries.