Skip to main content
GameDev.net gamedev.net
🔒 Locked

How to create "Crysis clouds"...

Started by fpsgamer Sep 8, 2006 at 6:25 AM 18 replies 8.4k views
Original Post
fpsgamer
fpsgamer
Fractal clouds look like crap compared to what they have in Crysis. What algo/technique do they use?
MePHyst0
MePHyst0
I would say they use some kind of volumetric clound hybrid rendering algo
cpiasminc
cpiasminc
The clouds themselves are doable with regular old particles (that don't move). I've managed to do just fine using 3 channels (XYZ) of Perlin noise range-bounded by a simple bounding box to compute the positions I use -- just that using something like linear interpolation is ugly; sinus interpolation works well enough. For more complex shapes of clouds, you just use multiple boxes to form a single cloud.

The main thing isn't really the cloud itself so much as how you light it. From what I've seen of Warhawk's clouds, I kind of surmise that what they do is a simple raycast to a lightsource testing for particle intersection within the cloud (treating each particle as a sphere) and attenutating the light based on how many intersections were found.
Light travels faster than sound. This is why many people appear very bright until they speak.
HellRaiZer
HellRaiZer
Quote:
Original post by cpiasminc
For more complex shapes of clouds, you just use multiple boxes to form a single cloud.

This is exactly what they do in Flight Simulator 2004 (Realistic and Fast Cloud Rendering), and from the presentation e-u-l-o-g-y posted they seem to use the same method for shading (as in FS2004). So nothing really tricky here. It is more of an artistic work.

Btw, this tracing of spheres and attenuating light would be interesting to investigate further. Maybe on GPU?
IIRC from their videos, smoke seems to be illuminated correctly (i don't know how exact is their method), so i suppose they must use something similar for it. Maybe not for the clouds, but for the smoke. Any ideas on that?

HellRaiZer

PS. Nothing of the above is 100% sure.
HellRaiZer
compiler
compiler
Damn, crysis looks awesome o.O
It looks like a real photo.... really impressive!
Matt Aufderheide
Matt Aufderheide
I recently implemented some clouds in my engine, mostly prompted by this thread..I think they turned out quite nice.. they are based on rendering batched sprites with some lighitng shaders.. they are real 3d clouds in a the world space.. not faked or on the skydome.. they float some way above the level, like real clouds.


HellRaiZer
HellRaiZer
Quote:

I recently implemented some clouds in my engine, mostly prompted by this thread..I think they turned out quite nice.. they are based on rendering batched sprites with some lighitng shaders.. they are real 3d clouds in a the world space.. not faked or on the skydome.. they float some way above the level, like real clouds.

The screenshots are pretty. May i ask what you are doing for lighting? Are you using the same procedure described in Wang's paper (FS2004)?

HellRaiZer

HellRaiZer
Matt Aufderheide
Matt Aufderheide
I didnt read Wangs paper actually..

basically i have two lighting tersm, one takes the base height of the cloud and darkens the sprite vertices by how far from the base they are--lower means darker--this gives nice shaded cloud bottoms.. then I calculate a spherical normal and do a lighting calculation from the sun, and then add it to the whole.
Matt Aufderheide
Matt Aufderheide
Yes you are right about the spherical normal :)

The texture is just sort of white cloud puff with alpha map.. actually two or more images appear on a texture and the image is chosen at random for each sprite.
Moe
Moe
I must say, it does look quite impressive! What sort of performance are you getting?
Schmerm
Schmerm
If different cloud particles potentially use different textures, are you binding/rebinding different textures for each cloud particle? Using an atlas? How do you keep performance good while switching textures for so many particles? Also, is the lighting shader for each particle aware of only itself locally, or does it take into account the effects of other particles besides itself?
Rompa
Rompa
I'm curious about the "spherical normal" with respect to the lighting. If the viewer was to circle around the cloud(s) then due to the normal being the vector from the billboard center to the vertices and with the vertices being oriented to the camera, would they not move and cause the normal to change relative to the stationary Sun causing the lighting on them to "rotate" of sorts? For a FPS player's perspective this wouldn't be an issue, but for a fly through it might be evident... Thoughts?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.