Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Herra Tohtori on September 02, 2011, 10:59:33 pm

Title: Clouds!
Post by: Herra Tohtori on September 02, 2011, 10:59:33 pm
After a brief discussion in #scp, zookeeper made this happen:

(http://img713.imageshack.us/img713/515/oneperfectmoment.png)


Currently produces square boring clouds. It's still N times better than not having clouds at all, but the clouds need to be about 20% cooler before this can be declared functional.

Set of problems includes:

-particles vanishing as their centre point goes off the screen
-particles rolling with camera (billboarding affects pitch/yaw/roll when it should only affect pitch and yaw)
-occasional slowdowns
-problems with controlling the size of individual particles (and thus the size of the clouds in general). Currently they are rather small.



Regardless, as this proof of concept shows, I'm confident that we'll eventually get properly working clouds in the game.


And yes, I do realize there are no clouds in the Moon, but that was the first mission I thought of when I needed a mission with terrain in it...
Title: Re: Clouds!
Post by: TwentyPercentCooler on September 02, 2011, 11:04:58 pm
Currently produces square boring clouds. It's still N times better than not having clouds at all, but the clouds need to be about 20% cooler before this can be declared functional.

You rang?   :D

For a proof of concept, this is freaking awesome. Knowing this community, something better than just clouds will come of this, too. Good work.
Title: Re: Clouds!
Post by: NeoKnight on September 03, 2011, 12:02:58 am
This would be an interesting feature to use in junction with the nebula effect. Keep up the great work!
Title: Re: Clouds!
Post by: m!m on September 03, 2011, 02:51:52 am
That looks great and it will add a great deal of realism to atmospheric missions :yes:
I just have a few questions on the way you achieved this effect:
You use lua for this? (most likely as you posted in the scripting forum)
How did you avoid that the particles vanish after their lifetime?

Anyway, great work :):yes:
Title: Re: Clouds!
Post by: Black Wolf on September 03, 2011, 02:56:25 am
This is very relevant to my interests! Good stuff HT - will we be able to have a play with it any time soon?
Title: Re: Clouds!
Post by: zookeeper on September 03, 2011, 03:02:25 am
That looks great and it will add a great deal of realism to atmospheric missions :yes:
I just have a few questions on the way you achieved this effect:
You use lua for this? (most likely as you posted in the scripting forum)
How did you avoid that the particles vanish after their lifetime?

Anyway, great work :):yes:

Yes, it's a lua script. And a really simple one, too: the whole .tbm holding the very basic preliminary test script is <50 lines.

The particles are created with ts.createParticle(), which allows you to set the lifetime and currently that's simply set to 9999999.
Title: Re: Clouds!
Post by: Nuke on September 03, 2011, 04:16:13 am
i think you can improve this a lot by only generating particles in a layer and not filling a volume with them. whats hapening is additive blinding is washing them out, so to avoid this try avoiding putting particles more than 3 layers deep. put in some large ones in the back and some little ones further out. if you put a bunch of white particles in one spot its just gonna clip to solid white like it did there.

what i would do is id go into a modeling program and model a cloud shaped blob (use a geosphere as a basis), then export as a ascii mode obj, and take the verts and their normals and put them in a file. write script to parse the points and normals as vectors. take the normals, and rotate them into world then camera space (you dont need to translate or frustum them) and figure out which verts point to the camera (they should have negative z). build a table of all the indices that are facing twards you, then iterate over it, get the position vectors at those indices, transform them to world space and draw particles at all their positions. do this every frame and make sure the particles last only one frame.
Title: Re: Clouds!
Post by: Ghostavo on September 03, 2011, 04:21:35 am
It will only get 20% cooler if you add a rainbow.
Title: Re: Clouds!
Post by: CommanderDJ on September 03, 2011, 07:00:00 am
Does this mean that mixed nebula/space missions will be possible?
Title: Re: Clouds!
Post by: Darius on September 03, 2011, 07:04:13 am
Looks like it'll benefit greatly from soft particles :)
Title: Re: Clouds!
Post by: headdie on September 03, 2011, 08:18:39 am
Useful for dust clouds in space, combined with an asteroid field could have some interesting effects
Title: Re: Clouds!
Post by: AndrewofDoom on September 03, 2011, 10:03:56 am
This will most certainly be useful for Stellar Assault seeing as one of the missions is in the atmosphere and takes place next to lots of clouds. Keep it up, because I like what I'm seeing!
Title: Re: Clouds!
Post by: Nighteyes on September 03, 2011, 05:30:27 pm
I've been experimenting with this sort of thing a while back, I made a pof file with a transparent cube with no collide, and made the cloud poofs using glow points...
unfortunately, the particles vanishing at the end of the screen is a big problem, and made me ditch the idea as this won't change anytime soon... also as you said having a few clouds like that produces quite a big slowdown

*if someone wants I can upload the cloud model I made
Title: Re: Clouds!
Post by: rscaper1070 on September 04, 2011, 12:25:38 am
I just happened on this engine called SkyWorks (http://www.markmark.net/SkyWorks/) tonight. It looks pretty cool and it's completely open source so I thought the code geniuses around here could crack it open I see if there was anything useful.
Title: Re: Clouds!
Post by: lostllama on September 06, 2011, 04:04:49 pm
Great work on this. :)

With some precipitation effects, together with nebula lightning, then storms could be simulated.

Add in wind effects and we could have weather fronts that evolve over time.... OK, maybe not. Making FS into a weather simulator is probably not going to happen, but features like this could add some new, perhaps random, challenges to the game.