<< RETURN
Realistic and Fast
Cloud Rendering in
Computer Games
Niniane Wang
Software Engineer
Microsoft Flight Simulator
(now at Google Inc)
Intro Video
1
Agenda
• Previous Work
• 3- D Modeling + Art Pipeline
• Performance
• Shading model
• Animation: Formation and Dissipation
• Q & A
(All slide backgrounds are actual screenshots.)
Previous Research
• Harris, S k y W o r k s
– Use GPU to improve performance
– Impostor for each cloud
• Dobashi
– Metaballs
– Anisotropic scattering
• Ebert, Blinn, others
2
Previous Games
• Flight Simulator 2002
– Each cloud is a single billboard
• Combat Flight Simulator 3
– Each cloud is a few unique billboards
• I L- 2 S t u r m o v i k
– Each cloud is a large number of small particles
Our Enhancements Over Previous
Systems
• Many distinct cloud types (e.g. altocumulus,
cumulonimbus)
• Art pipeline allows fine -grained control
over model and shading
• Real-time performance (15 – 60 fps)
– Even for overcast scenes
3
Concept: Cluster of Sprites
Each cloud is composed of 5 – 50 textured sprites.
Cloud Creation
Each cloud is created by artists in 3D Studio Max.
• Use boxes to build cloud shape.
• Custom-written Max script to randomly fill boxes with
sprites.
• Immediate visual feedback
• Export final model to a file to load into game
4
Cloud Creation Video
Artist-specified Parameters
• # sprites to control cloud density
• Category (“stratus”, “solid cumulus”) to
detemine texture
• Range for width and height of sprite
• Range of rotation for each sprite to give
more variety
5
Cloud Sprite Generation
• Artist presses a button…
• 3 D S M a x p l u g- in creates a list of randomly
placed sprite centers
• It culls all sprites whose centers are within a
“cull radius” of each other
– Cull radius of 1/3 of cloud height is good for
typical clouds, 1/5 for dense clouds
Real- World Cloud Types
Real life cloud types have distinct looks
• Cumulus, stratus, cumulonimbus
• Sub -categories
6
Simulating Cloud Types
Mix and match 16 textures
• Solid puffs for cumulus, blurry
puffs for stratus,
• Less video memory than using
unique textures for each cloud
Cloud Types Video
7
In
In-- Cloud Experience
• Sprite disappears as the camera passes through it
• Advantages of using cluster of sprites:
– Consistent with cloud as seen from the outside – wispy parts are
still wispy
– Each cloud has different in -cloud experience, unlike with
canned animation
In-cloud problems and solutions
• Initially, “parting of the Red Sea” problem
• Solve by locking the sprite within a distance
• This causes sprite edges to be visible
• Solution: Take dot product of lock angle and angle to
camera, and adjust sprite transparency
8
In
In-- Cloud Video
Performance
• Requirements:
– Flight Simulator must maintain 15 to 60 fps
– Overcast scenes are the biggest challenge
– Emulate real-world conditions (“Real- World
Weather” feature)
– Range of machines: 700 MHz to 3.0 GHz
9
Performance: Impostors
Main bottleneck is in overdraw
Reduce overdraw by rendering
multiple clouds into a single
billboard
Ring of Impostors
Octagonal ring around user eyepoint
• Clouds within ring are drawn in 3 - D
10
Impostors
• Render same billboard across many frames
• Dynamically update impostor upon position/time change
– Empirical results are 15% of impostor ring radius horizontally a nd
2% vertically
– Time change of 10 minutes
• User can set ring radius
– Smaller ring means better performance but more visual anomalies
Impostors: Visual Anomalies
• Parallax
• Interaction with terrain and objects
• Rendering to texture not supported across all video card
hardware
• Gray edges (the “silver lining”)
11
Fallback on older systems
• On old systems (< 450 MHz), even
rendering a single block of 3- d sprites is too
expensive
• Fall back to L o D scheme of single-billboard
clouds
– This is a degenerate case of our cluster of
sprites model
Performance Results
12
Impostor Video
Shading
• We chose artist -driven system rather than
simulating scattering of light
• Model lighting for different times of day
• Ambient and directional
13
Ambient Shading
Simulate the filtering of light from the sky
• Clouds have dark bottoms, esp. cumulus
• Artist specifies 5 “color levels”. Each level is a height
with associated RGBA color.
– Color also used to give cloud types their distinct look (e.g.
more transparency for stratus)
Illustration of Color Levels
14
Ambient Shading Computation
• Interpolate maximum ambient RGBA for given time of
day
• For each cloud vertex
– Interpolate its ambient percentage of maximum value, based on
vertex height within the cloud
– Multiply by maximum RGBA
Ambient Shading Video
15
Directional Shading
• Parts of the cloud facing the sun receive more
directional sunlight
• Artist specifies
– Shading groups (sections of 1 -30 sprites that are
shaded as a unit)
– Maximum directional color for a set of times
throughout the day
Directional Shading Computation
• Find maximum directional RGBA for a given time of
day
• For a vertex:
– Compute dot product of (vector from cloud center to
sun) with (vector from vertex to cloud center)
– Multiply by interpolated maximum color
16
Illustration for Directional Light
Directional Shading Video
17
Animation
Adjust transparency values of sprites
• Form clouds from core first
– Multiply cloud vertex with transparency factor based on its
distance from cloud center
– Render all of core first before edges
• Dissipate from edges
Animation Video
18
Limitations and Future Work
• Not suited for flat clouds (i.e. cirrus)
• Extension to fog and smoke
• Form animations on meteorological data and fluid
simulation
• Pre-computed self-shadowing term
Contact info, Q& A
• E- mail: niniane@ofb.net
• http://ofb.net/~niniane/clouds
Acknowledgements to two extraordinarily talented artists --
John Smith, Adrian Woods -- and the Microsoft Flight
Simulator development team.
19