Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Volumetric Clouds [Matrix1 + Simplex Noise plugins]

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 26th May 2012 13:24 Edited at: 26th May 2012 13:26
Attached is the project and the single decal image used as the texture but the full code is


Volumetric Clouds using 3D simplex noise algorithm

Everything seems to be going perfect but as the screenshot shows, there's a glitch in the 3D rendering. I'm thinking that it's something to do with the transparency and the alpha mapping of the objects. Ah well, posted it anyway...



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Attachments

Login to view attachments
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 26th May 2012 13:24 Edited at: 26th May 2012 13:25
Screenshot

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Attachments

Login to view attachments
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 26th May 2012 21:10 Edited at: 26th May 2012 21:11
Coolness!!! Get those lines fixed up and put in some kind of light scattering effect stuff to get the darker underside of clouds and mabie we'll have the free version of Dark Clouds This should be fun to play around with. Thanks for sharing

ExoDev.Com - A Game Development Tools Website! Featuring: XBOX360 CONTROLLER LIBRARY
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 27th May 2012 05:05
Although I have paid for Broken DarkClouds I am looking forward to this one as I could do with a lower spec volumetric clouds system

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 28th May 2012 13:24 Edited at: 28th May 2012 13:34
If you put

DISABLE OBJECT ZWRITE iObj_count

after

point object iObj_count, 0, 0, 0

in function wlCreateCloud, it may look at tad bit better.

After some web searching, it seems the alphablended 3d objects needs to be zwrite disabled and also have some way of doing your own z-sorting of those objects. I'm guessing and assuming that's why those unwanted lines are in the clouds like that.

So, with that idea in mind about zwrite disabled and needing zsorting... DBPro sprites came to mind. I have coded the example with using sprites that are positioned and sized according to where the objects are located at. For me, this method isn't practical as the more sprites, slower it gets. Plus, I had to use the Object Screen commands to help position the sprites. With that, when the objects go off the screen or go behind the camera... weird things can happen.

Bottom line is at least the cloud looks nicer

* I was trying to put in cloud density via using a 3d array to set a light scattering technique, but with the for/next/if statements, it was making the program come to a crawl. I might attempt a c++ dll.





ExoDev.Com - A Game Development Tools Website! Featuring: XBOX360 CONTROLLER LIBRARY

Attachments

Login to view attachments
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 28th May 2012 20:20
Wow, that does look so much better. I never even thought to disable the z thingy.

And I forgot I posted this too but it's great to see a definite improvement...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 29th May 2012 04:42 Edited at: 1st Jun 2012 02:29
Thanks. One way I could of optimized that code would of just been to create one object plain and just used that to update the sprite positions. That would of cut back on dbpro dealing with an object plain for each sprite.

I have one more idea I want to try out which involves creating a single mesh and updating vertices to act like an object plain. Vertex alpha should help out also. This should eliminate the need to manually zsort alpha objects( ie: in which I don't see how one could with dbpro ). This should be interesting.


Edit: I got it to work, but it just turned out as good as your original version. Still need to do own zsortng and DBPro is just to slow for all of that.

ExoDev.Com - A Game Development Tools Website! Featuring: XBOX360 CONTROLLER LIBRARY

Login to post a reply

Server time is: 2024-04-19 20:33:31
Your offset time is: 2024-04-19 20:33:31