How to make a PIXAR movie?

advertisement
How to make a PIXAR movie
Global Illumination Effects
computer graphics & visualization
Motivation
• Realistic illumination of the scene
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Motivation
• Soft shadows
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Motivation
• Subsurface scattering
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Motivation
• Many algorithms exist
– Photon mapping
– Ambient Occlusion
–…
• Common goal: Solving parts of the Rendering
Equation
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Problems
• Scene changes -> New computation
• Still not possible in real-time
• Uses Raytracing or Radiosity
Already explained
Going to be
explained now
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Photons
• Have energy
E  hv
• h: Planck constant
• v: Frequency of light
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiometric Quantities
Radiant energy
Q
J
Radiant power
dQ

dt
W
Irradiance
d
E
dA
W/m²
Radiosity
d
B
dA
d
I 
d
W/m²
Radiant intensity
W/sr
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiance
d ²
L

dAd  cos 
• θ: angle between surface‘s normal and ω
•cosθ: Lambertian law
•Constant along a ray
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Irradiance
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
BRDF
Bidirectional reflectance distribution function
dLr ( x, r )
f r (i , x, r ) 
Li ( x, i ) cosi di
How much light is reflected
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Reflection Equation
Integrate over the hemisphere
 
Lr ( x , r ) 

  

 
f r (i , x , r ) Li ( x , i ) cos  i di

Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Rendering Equation
BRDF
 
 
L( x , r )  Le ( x , r ) 
Emitted
light


yS
Radiance
Geometry
factor
  
 
 
 
f r (i , x , r )  L( y,i ) V ( x , y )  G ( x , y )  dAy
Surfaces
Visibility
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity
• Ideal diffuse reflection can be simulated with
Radiosity
• Uses finite elements
• Introduced by Goral et al.
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity
• Origin: Thermal heat transfer
• Developed in 1984, still in use
• Modelling of diffuse lighting
– Doesn‘t account for specular lighting
– Independent of viewer
– Therefore: Stays constant in constant scene
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity Equation
constant
Emissivity
Bi  B  
 
 
L( x , r )  Le ( x , r ) 
Radiosity
B F
  
 
 
 
e
 f ( , x,  )  L( y, ) V ( x, y)  G( x, y)  dA
i
i
j ij
j

yS
r
i
r
Reflectivity
i
y
Form
factor
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Form Factors
1
Fij 
Ai

Ai A j
cos  i cos  j
r ²
dA j dAi
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Form Factors
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Nusselt Analog
• Simple geometric analog for calculating form
factors
B
A
A
Fij 
B
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Hemicube Algorithm
• Hemicube instead of hemisphere
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Hemicube Algorithm
• Idea:
– Precompute delta form factors analytically
– Count covered pixels
– Sum up covered delta form factors to the true form
factor
Fij   Fq
q
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Hemicube Example
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Hemicube Algorithm on GPU
•
•
•
•
•
•
Use projection center as viewport
Use current face as viewing plane
Do the rendering
Grab the colour buffer (IDs of patches)
Count coloured pixels
Visibility test performed by depth test
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity Algorithm
• Compute form factors
• Solve linear equation system
Bi  Bie  i  B j Fij for i = 1, … , n
j
1  1 F11  1 F12
 F
1


F
2
21
2
22

 


   n Fn1   n Fn 2
 1 F1n   B1   E1 
   2 F2 n   B2   E2 

     


   
 1   n Fnn   Bn   En 

(1  T )
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Von Neumann Series
B  E  TB  E  TE  T ² B
 ...
 T E  T E  T E  T E  ...
0
B
( 0)
0 Bounces
1
B B
(1)
1 Bounce
2
( 2)
3
B
( 3)
2 Bounces
 ...
3 Bounces
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Jacobi Iteration
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Shooting / Gathering
 E   ( F )B
j 1
B
i
( k 1)
i
i
N
X  X  
    
  
X   X   
    
X  X  
X

X
X
ij
j
(k )
 
 
 
 X 
 
 
    
X  X  X
   
    
    
    
( k 1)
i
B
X
 X 
 X   X 
  
 
 X 
N
 Ei   ( i Fij ) B (j k )
j 1
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity Result
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity vs. Ray Tracing
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Radiosity Conclusion
• Old, but still in use
• Used for simulating diffuse lighting
• Result can be used in combination with other
GI algorithms
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Ambient Occlusion Motivation
• Ambient term constant in Phong model
• Not very realistic
• Idea: Compute occlusion of each face
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Ambient Occlusion
• Result: Occluded areas appear darker than
brigther ones
• Multiply with usual Phong model
• 2 possibilities:
– Screen space
– Object space
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Screen Space Ambient Occlusion
•
•
•
•
Can be completely done on GPU
No preprocessing
Independent of scene complexity
Idea: Instead of performing full raytracing use
occlusion information from z-buffer
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Screen Space Ambient Occlusion
• Take 3D samples around each point
• Determine occlusion of each point by testing
against the depth buffer
• Far samples with less influence
• Use blurring for smooth results
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Screen Space Ambient Occlusion
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Object Space Ambient Occlusion
• Define surface element as an oriented disk
• Use Heron‘s formula s(s  a)(s  b)(s  c) , s  a  2b  c
• Store position, normal and area in texture for
pixel shader
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Object Space Ambient Occlusion
• Compute accessibility value at
each element (% of hemisphere)
• Approximation based on the
solid angle of an oriented disk
r cos E max(1,4 cos R )
1
A
 r²

• Strongly dependent on scene
complexity
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Object Space Ambient Occlusion
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Ambient Occlusion Results
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Ambient Occlusion Results
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Ambient Occlusion Conclusion
• Can be preprocessed for each object
• Used in the current version of PIXAR‘s
RenderMan
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Outlook
• Faster computation
– Cheaper
– Artists can see results faster
• More realistic lighting
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Conclusion
• Very important for any animated movie
• Computation time not too important
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Thanks for your attention!
Global Illumination Effects
Christian A. Wiesner
computer graphics & visualization
Download