Riven
|
 |
«
Posted
2006-08-13 01:47:27 » |
|
Weeee! A self-shadowing smoke-simulator, with a crap framerate! Download the non-webstartable zipper  You need a fairly fast computer to get this running smooth, as it raytraces itself every frame. 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 = specularW+S = diffuseD+E = ambientR+F = light angleT+G = transparancyI wish the best of luck to all of those without a QWERTY keyboard
|
|
|
|
thijs
Junior Member  
Lava games rock!
|
 |
«
Reply #1 - Posted
2006-08-13 08:41:06 » |
|
Looks really nice! Planning to use it in a game you're working on?  On the client vm I also get around 5fps (P4 2.8Ghz / 6600GT)
|
|
|
|
Riven
|
 |
«
Reply #2 - Posted
2006-08-13 10:15:57 » |
|
It could be used in a game  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.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
darkprophet
Senior Member   
Go Go Gadget Arms
|
 |
«
Reply #3 - Posted
2006-08-13 12:15:46 » |
|
* darkprophet tsks... No linux natives... DP
|
|
|
|
Orangy Tang
|
 |
«
Reply #4 - Posted
2006-08-13 13: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).
|
|
|
|
Markus_Persson
|
 |
«
Reply #5 - Posted
2006-08-13 14:57:21 » |
|
Oooh, sweet.  This could be used to build sweet looking dynamic cloud billboards for wurm.. is it open source or similar? :-D
|
|
|
|
Riven
|
 |
«
Reply #6 - Posted
2006-08-13 18:04:23 » |
|
Orangy Tang: That happens when some 'blob' moves outside the octtree, which I assumed was impossible. Oh well  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!
|
|
|
|
blahblahblahh
|
 |
«
Reply #7 - Posted
2006-08-13 21:55:45 » |
|
...please? Pretty please?
|
malloc will be first against the wall when the revolution comes...
|
|
|
Riven
|
 |
«
Reply #8 - Posted
2006-08-14 12:03:21 » |
|
Blahblahblah: I tried the easy way, but javagamesfactory.org is down  I'll add it tonight.
|
|
|
|
Markus_Persson
|
 |
«
Reply #9 - Posted
2006-08-14 16:01:20 » |
|
<threadjack> Markus Persson: I dropped you a private message! Did you get my reply? :-) </threadjack>
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Riven
|
 |
«
Reply #10 - Posted
2006-08-14 18: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  will upload it later. Markus: I'll drop you another private message in a few hours.
|
|
|
|
CaptainJester
|
 |
«
Reply #11 - Posted
2006-08-14 20:43:09 » |
|
This is what I got: 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.
|
|
|
|
Riven
|
 |
«
Reply #12 - Posted
2006-08-14 21: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
|
|
|
|
CaptainJester
|
 |
«
Reply #13 - Posted
2006-08-15 00:20:44 » |
|
Slightly better on my home machine 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
|
|
|
|
Riven
|
 |
«
Reply #14 - Posted
2006-08-15 00:31:52 » |
|
*g* I haven't uploaded it yet, will do it in a few minutes. Update: updated 
|
|
|
|
Mike Jacobs
|
 |
«
Reply #15 - Posted
2006-08-15 01: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
|
|
|
|
CaptainJester
|
 |
«
Reply #16 - Posted
2006-08-15 05:13:36 » |
|
New version started out nice: 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 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
|
|
|
|
Riven
|
 |
«
Reply #17 - Posted
2006-08-15 09: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. 
|
|
|
|
Riven
|
 |
«
Reply #18 - Posted
2006-08-19 12:24:59 » |
|
Few renders of first version of clouds that might be used in a game, eventually  It's a long road ahead though, as these clouds still look a bit cartoonic.



|
|
|
|
Koen Samyn
Senior Newbie 
|
 |
«
Reply #19 - Posted
2006-08-19 22:29:22 » |
|
Renders on my laptop at 10fps too now. It's a steady 100ms per frame on JDK 1.6. Looks very nice  I lost the mouse cursor though during the demo, but maybe that is LWJGL specific. Koen
|
|
|
|
Evil-Devil
|
 |
«
Reply #20 - Posted
2006-08-22 13:37:12 » |
|
It runs...but i got this exception continues  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
|
|
|
|
|
tortoise
|
 |
«
Reply #21 - Posted
2006-09-06 18: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?
|
|
|
|
|
Riven
|
 |
«
Reply #22 - Posted
2006-09-07 14:57:03 » |
|
Thanks for your feedback! The mouse is grabbed for absolutely no reason at all  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:



|
|
|
|
kappa
|
 |
«
Reply #23 - Posted
2006-09-07 14:57:51 » |
|
dying to try this on linux via webstart 
|
|
|
|
|
darkprophet
Senior Member   
Go Go Gadget Arms
|
 |
«
Reply #24 - Posted
2007-03-15 20: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
|
|
|
|
donotmentionit
|
 |
«
Reply #25 - Posted
2007-03-18 12: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  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.  ... 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.
|
|
|
|
|
|
|
nva225
|
 |
«
Reply #27 - Posted
2007-03-18 21: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?
|
|
|
|
|
Riven
|
 |
«
Reply #28 - Posted
2007-03-18 23: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 
|
|
|
|
nva225
|
 |
«
Reply #29 - Posted
2007-03-19 00: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.
|
|
|
|
|
|