Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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  
  Got a smoke?  (Read 9211 times)
0 Members and 1 Guest are viewing this topic.
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Posted 2006-08-12 23:47:27 »

Weeee!

A self-shadowing smoke-simulator, with a crap framerate! Grin


Download the non-webstartable zipper







You need a fairly fast computer to get this running smooth, as it raytraces itself every frame. Roll Eyes

P4 2.4GHz / ATi 9700pro -> 5fps (client vm 1.5) -> 10fps (server vm 1.5)

All raytracing, sorting, shading and lighting is done on the CPU. Argh!
Rendering the 2k sprites is done by the GPU.

The first versions did 10s / frame, I'm glad it is running at interactive framerates.
4 rays per sprite (every corner) are used for realistic shading.



You can poke a few keys to change the variables:
Q+A = specular
W+S = diffuse
D+E = ambient
R+F = light angle
T+G = transparancy

I wish the best of luck to all of those without a QWERTY keyboard

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline thijs

Junior Devvie




Lava games rock!


« Reply #1 - Posted 2006-08-13 06:41:06 »

Looks really nice! Planning to use it in a game you're working on? Wink

On the client vm I also get around 5fps (P4 2.8Ghz / 6600GT)

<a href="http://www.dzzd.net">3DzzD!</a>
<a href="http://www.arcazoid.com">Arcazoid!</a>
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2006-08-13 08:15:57 »

It could be used in a game Smiley when it is updated every once in a while, probably updating in some low-priority thread.

Even the fillrate is a problem, it is a 2k particle engine after all, so it should probably be rendered to an imposter.
The current version is clearly CPU limited so using the server-vm is the most important speedup.

Oh, and the new updated version takes advantage of multiple CPU-cores.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darkprophet

Senior Devvie




Go Go Gadget Arms


« Reply #3 - Posted 2006-08-13 10:15:46 »

* darkprophet tsks...

No linux natives...

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2006-08-13 11:54:32 »

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  
engine running
engine -> main -> EngineSkeleton.initDisplay() [Requested DisplayMode: 800 x 600 @85Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @70Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @56Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @85Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @75Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @60Hz]
engine -> main -> EngineSkeleton.initDisplay() [Found DisplayMode: 800 x 600 x 32 @72Hz]
engine -> main -> EngineSkeleton.initDisplay() [Selected DisplayMode: 800 x 600 x 32 @85Hz]
engine -> main -> EngineSkeleton.initDisplay() [Using custom pixelformat: 0xFSAA, 24bit depth, 24bpp
]
engine -> main -> GLChecks.printStats() [Operation System: Windows XP 5.1 (x86, CPUs: 1)]
engine -> main -> GLChecks.printStats() [Java Platform: 1.5.0_06-b05 (Compiler: Java HotSpot(TM) Cli
ent VM)]
engine -> main -> GLChecks.printStats() [OpenGL: 2.0.1 (driver: 6.14.10.8194)]
engine -> main -> GLChecks.printStats() [GPU: GeForce 6600 GT/AGP/SSE/3DNOW! by NVIDIA Corporation]
engine -> main -> GLChecks.printStats() [Texture Support: 4 units, 4096^2 pixels]
engine -> main -> GLChecks.printStats() [[x] Shader Programs]
engine -> main -> GLChecks.printStats() [[x] HP occlusion]
engine -> main -> GLChecks.printStats() [[x] ARB occlusion]
engine -> main -> GLChecks.printStats() [[x] Vertex Buffer Objects]
engine -> main -> GLChecks.printStats() [[x] Frame Buffer Objects]

animating took 57ms
raytracing on 1 cores took 265ms

animating took 41ms
raytracing on 1 cores took 222ms

animating took 41ms
raytracing on 1 cores took 206ms

animating took 42ms
raytracing on 1 cores took 212ms

animating took 41ms
raytracing on 1 cores took 204ms

animating took 41ms
raytracing on 1 cores took 205ms

animating took 41ms
raytracing on 1 cores took 204ms

animating took 43ms
raytracing on 1 cores took 200ms

animating took 41ms
raytracing on 1 cores took 204ms

animating took 43ms
raytracing on 1 cores took 204ms

animating took 41ms
raytracing on 1 cores took 205ms

animating took 42ms
raytracing on 1 cores took 204ms

animating took 41ms
raytracing on 1 cores took 211ms

animating took 67ms
raytracing on 1 cores took 188ms

animating took 41ms
raytracing on 1 cores took 211ms

animating took 44ms
raytracing on 1 cores took 231ms

animating took 41ms
raytracing on 1 cores took 216ms

animating took 41ms
raytracing on 1 cores took 213ms

animating took 42ms
raytracing on 1 cores took 220ms

animating took 42ms
raytracing on 1 cores took 224ms

base -> main -> Ticker.loop() [null]
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.build(WorldRenderer.java:396)
        at com.eyeriv.game.client.WorldRenderer.display(WorldRenderer.java:454)
        at engine.opengl.RenderManager.render(RenderManager.java:48)
        at com.eyeriv.game.client.ClientEngine$2.tick(ClientEngine.java:96)
        at com.eyeriv.time.Ticker.loop(Ticker.java:123)
        at com.eyeriv.time.Ticker.start(Ticker.java:87)
        at com.eyeriv.game.client.ClientEngine.init(ClientEngine.java:66)
        at com.eyeriv.game.client.ClientEngine.main(ClientEngine.java:20)
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.build(WorldRenderer.java:396)
        at com.eyeriv.game.client.WorldRenderer.display(WorldRenderer.java:454)
        at engine.opengl.RenderManager.render(RenderManager.java:48)
        at com.eyeriv.game.client.ClientEngine$2.tick(ClientEngine.java:96)
        at com.eyeriv.time.Ticker.loop(Ticker.java:123)
        at com.eyeriv.time.Ticker.start(Ticker.java:87)
        at com.eyeriv.game.client.ClientEngine.init(ClientEngine.java:66)
        at com.eyeriv.game.client.ClientEngine.main(ClientEngine.java:20)


Runs for a few seconds, the quits with the above error. Looks really nice though (even at about two frames a second).

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #5 - Posted 2006-08-13 12:57:21 »

Oooh, sweet. Cheesy

This could be used to build sweet looking dynamic cloud billboards for wurm.. is it open source or similar? :-D

Play Minecraft!
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2006-08-13 16:04:23 »

Orangy Tang: That happens when some 'blob' moves outside the octtree, which I assumed was impossible. Oh well Smiley

DarkProphet: I bet you're skilled enough to drop the linux-binaries inthere, enjoy it!

Markus Persson: I dropped you a private message!




Thanks for the feedback!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2006-08-13 19:55:45 »


...please? Pretty please?

malloc will be first against the wall when the revolution comes...
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #8 - Posted 2006-08-14 10:03:21 »

Blahblahblah: I tried the easy way, but javagamesfactory.org is down Undecided

I'll add it tonight.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #9 - Posted 2006-08-14 14:01:20 »

<threadjack>
Markus Persson: I dropped you a private message!
Did you get my reply? :-)
</threadjack>

Play Minecraft!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #10 - Posted 2006-08-14 16:35:50 »

Today I spent a bit too much time on optimising this thingy, and made it about 50% faster by changing the way the blobs are stored in blob-space Wink will upload it later.

Markus:
I'll drop you another private message in a few hours.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #11 - Posted 2006-08-14 18:43:09 »

This is what I got:
Quote
animating took 23ms
raytracing on 1 cores took 159ms

base -> main -> Ticker.loop() [null]
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.build(WorldRenderer.java:396)
        at com.eyeriv.game.client.WorldRenderer.display(WorldRenderer.java:454)
        at engine.opengl.RenderManager.render(RenderManager.java:48)
        at com.eyeriv.game.client.ClientEngine$2.tick(ClientEngine.java:96)
        at com.eyeriv.time.Ticker.loop(Ticker.java:123)
        at com.eyeriv.time.Ticker.start(Ticker.java:87)
        at com.eyeriv.game.client.ClientEngine.init(ClientEngine.java:66)
        at com.eyeriv.game.client.ClientEngine.main(ClientEngine.java:20)
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.build(WorldRenderer.java:396)
        at com.eyeriv.game.client.WorldRenderer.display(WorldRenderer.java:454)
        at engine.opengl.RenderManager.render(RenderManager.java:48)
        at com.eyeriv.game.client.ClientEngine$2.tick(ClientEngine.java:96)
        at com.eyeriv.time.Ticker.loop(Ticker.java:123)
        at com.eyeriv.time.Ticker.start(Ticker.java:87)
        at com.eyeriv.game.client.ClientEngine.init(ClientEngine.java:66)
        at com.eyeriv.game.client.ClientEngine.main(ClientEngine.java:20)

Every animation cycle was about the same.  It only ran for about 20 seconds then got the exception.

Pentium 4 2.66GHz
768MB RAM
Intel 82865G onboard graphics card
Windows 2000

This is my work machine, so not bad with the crap video card.

Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #12 - Posted 2006-08-14 19:08:59 »

Yeah, nothing to be scared about, same error as OrangyTang got, the next version won't have this bug, as I fixed the octtree

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #13 - Posted 2006-08-14 22:20:44 »

Slightly better on my home machine
Quote
animating took 25ms
raytracing on 1 cores took 180ms

animating took 25ms
raytracing on 1 cores took 135ms

animating took 34ms
raytracing on 1 cores took 128ms

animating took 25ms
raytracing on 1 cores took 147ms

Windows XP
AMD Athlon64 3000+
512MB
ASUS Radeon 9600PRO 128MB

Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #14 - Posted 2006-08-14 22:31:52 »

*g* I haven't uploaded it yet, will do it in a few minutes.

Update: updated Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Mike Jacobs

Junior Devvie





« Reply #15 - Posted 2006-08-14 23:20:11 »

4 rays per sprite (every corner) are used for realistic shading.
Are you using only one white directional light?  If so, have you considered using the cloud image to create a normal map and using a DOT3 combine mode to get the shading for free in the GPU?

Mike

Special Effects for Java 3D games: http://www.indietechnologies.com
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #16 - Posted 2006-08-15 03:13:36 »

New version started out nice:
Quote
animating took 12ms
raytracing on 1 cores took 90ms

animating took 11ms
raytracing on 1 cores took 91ms

animating took 11ms
raytracing on 1 cores took 91ms

animating took 11ms
raytracing on 1 cores took 93ms

But slowed down after about 15 seconds

Quote
animating took 11ms
raytracing on 1 cores took 149ms

animating took 13ms
raytracing on 1 cores took 148ms

animating took 12ms
raytracing on 1 cores took 145ms

Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #17 - Posted 2006-08-15 07:06:01 »

4 rays per sprite (every corner) are used for realistic shading.
Are you using only one white directional light?  If so, have you considered using the cloud image to create a normal map and using a DOT3 combine mode to get the shading for free in the GPU?

Mike

Each corner of a sprite can be individually shadowed by another sprite, so it's not only about the spherical appearance. It might be overkill, but that's not the bottleneck of the code anyway. The part that spends 90% of the cycles is traveling through the octtree - which, although is has been optimised already, has enough room for improvement by changing the design all together. Maybe an order of magnitude, but we'll see about that. Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #18 - Posted 2006-08-19 10:24:59 »

Few renders of first version of clouds that might be used in a game, eventually Smiley

It's a long road ahead though, as these clouds still look a bit cartoonic.










Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Koen Samyn

Senior Newbie





« Reply #19 - Posted 2006-08-19 20:29:22 »

Renders on my laptop at 10fps too now. It's a steady 100ms per frame on JDK 1.6. Looks very nice Smiley

I lost the mouse cursor though during the demo, but maybe that is LWJGL specific.

Koen

Offline Evil-Devil

Senior Devvie


Medals: 2


Fir Tree Master


« Reply #20 - Posted 2006-08-22 11:37:12 »

It runs...but i got this exception continues Sad
Quote
base -> TaskDispatcher[grp=0]:0 -> Task.exec() [Task [com.eyeriv.game.client.Wor
ldRenderer$1@85af80] threw exception]
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.rayHits(WorldRenderer.java:329)
        at com.eyeriv.game.client.WorldRenderer.selfShadow(WorldRenderer.java:30
3)
        at com.eyeriv.game.client.WorldRenderer.raytrace(WorldRenderer.java:274)

        at com.eyeriv.game.client.WorldRenderer.access$3(WorldRenderer.java:216)

        at com.eyeriv.game.client.WorldRenderer$1.run(WorldRenderer.java:533)
        at com.eyeriv.util.Task.exec(Task.java:68)
        at com.eyeriv.util.TaskExecuter.run(TaskDispatcher.java:373)
        at java.lang.Thread.run(Unknown Source)
raytracing on 2 cores took 70ms
Offline tortoise

Junior Devvie




<3 Shmups


« Reply #21 - Posted 2006-09-06 16:37:35 »

Pretty cool. I had it going at about 10fps on my work computer which has a Radeon 9800 Pro with 128MB.

But why does the app grab the mouse? Does the mouse do anything?
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #22 - Posted 2006-09-07 12:57:03 »

Thanks for your feedback!

The mouse is grabbed for absolutely no reason at all Smiley

As for the lack of updates, I'm still working on newer versions the few hours I enjoy to have spare. So progress is slow.



Some screeeenz:









Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #23 - Posted 2006-09-07 12:57:51 »

dying to try this on linux via webstart Smiley
Offline darkprophet

Senior Devvie




Go Go Gadget Arms


« Reply #24 - Posted 2007-03-15 19:01:22 »

Arrrise zombie thread!

This guy posted a non-realtime photo of a cloud on gamedev.net and everyone was impressed. So naturally I wanted to link to this to show em "THE AWSOME POWER OF JAVA", but the latest zip keeps throwing NPE exceptions and the smoke flickers.

Any chance for a fix?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline donotmentionit

Innocent Bystander





« Reply #25 - Posted 2007-03-18 11:15:34 »

For some mysterious reasons I can't reply to this thread with my own account, so - I had this vision to create a new account Roll Eyes


To answer your question: the posted version is so optimized I really can't change it anymore.
More officially: the product has reached it EOL phase for support. Wink
... but read on!



Here are some or the latest (yet months old) screenies:








I got stuck in this project, as performance never got into the acceptable range. Remember I'm only rendering 1 cloud here, and it takes 425ms. Rendering a sky full of clouds would take forever, and require an incredible amount of RAM (this cloud uses 32MB for the volumegrid).

I am however in the process of designing (not coding) a new way to get this effects done in realtime.

You'll see it when I'm done, but my study is taking slightly too much time from me to put the ideas into code.
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #26 - Posted 2007-03-18 11:30:23 »

 Shocked

And now - after months - I can reply again with my own account in this thread Grin

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline nva225

Junior Devvie





« Reply #27 - Posted 2007-03-18 20:50:31 »

Well, I tried out your demo on a 2.16ghz core duo (which I didn't have when you first posted this)... and there's both good and bad news. Good news is I get between 33-45 fps, which is pretty awesome. Bad news is it seems to flicker like crazy. Parts of the clouds alternate between black and white constantly (not entire black/white, I mean dark/light kinda). And every half a second or so it seems like it's stuttering for some reason.

From your console output it looks like you're recognizing 2 cores. Do you have some specific code for multiple processors that would make it function differently?
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 848
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #28 - Posted 2007-03-18 22:09:44 »

Nope, it doesn't (AFAIK) utilize more than one core. Maybe though... it's a while ago, and I remember I did all funny things with threading at the time... Doing things in parallel (which is very easily done with the algorithm) on your computer might cause the flickering... I think, if I didn't sync it properly to the rendering-thread... Anyway, I might give this project another try rather soon, as I'm always motivated by people that actually try to run my stuff Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline nva225

Junior Devvie





« Reply #29 - Posted 2007-03-18 23:39:35 »

Hmm I ran the program again on my slower computer... I'm not sure but it might just look flickery because it's running faster. If I adjust the settings so the "contrast" of the clouds is lower, it doesn't look so bad. Also the faster computer is throwing those
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
base -> TaskDispatcher[grp=0]:0 -> TaskExecuter.run() [Task [com.eyeriv.game.client.WorldRenderer$1@cfec48] threw exception]
java.lang.NullPointerException
        at com.eyeriv.game.client.WorldRenderer.rayHits(WorldRenderer.java:329)
        at com.eyeriv.game.client.WorldRenderer.selfShadow(WorldRenderer.java:303)
        at com.eyeriv.game.client.WorldRenderer.raytrace(WorldRenderer.java:273)
        at com.eyeriv.game.client.WorldRenderer.access$3(WorldRenderer.java:216)
        at com.eyeriv.game.client.WorldRenderer$1.run(WorldRenderer.java:533)
        at com.eyeriv.util.Task.exec(Task.java:68)
        at com.eyeriv.util.TaskExecuter.run(TaskDispatcher.java:373)
        at java.lang.Thread.run(Unknown Source)

errors (while the slower one doesn't), which might be causing the lagging.
Pages: [1]
  ignore  |  Print  
 
 

 
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!