materials shading
play

Materials & Shading CPSC 453 Fall 2018 Sonny Chan Materials - PowerPoint PPT Presentation

Materials & Shading CPSC 453 Fall 2018 Sonny Chan Materials Rendered by Unreal Engine The appearance of a material is determined by the manner in which light is reflected from it, or transmitted through it. What is the most basic


  1. Materials & Shading CPSC 453 – Fall 2018 Sonny Chan

  2. Materials Rendered by Unreal Engine

  3. The appearance of a material is determined by the manner in which light is reflected from it, or transmitted through it.

  4. What is the most basic material property?

  5. Colour: Spectral Reflectance Curves [from scratchapixel.com]

  6. But not the only factor! RenderMan PxrLM

  7. Let’s take a look at some real world materials

  8. Hand with Reflecting Sphere (Self-Portrait) M.C. Escher, 1935

  9. Ideal Specular Reflections r = d − 2( d · ˆ n )ˆ n Trace another ray, as if you were looking from underneath.

  10. Real surfaces are not perfectly specular!

  11. Real surfaces are not perfectly specular!

  12. Mixed Specular Reflections r = d − 2( d · ˆ n )ˆ n Add fraction of ray’s light with to surface material colour.

  13. But wait a minute… dielectric (non-conductor) metallic (conductor) What’s the difference?

  14. Metallic Specular Reflections r = d − 2( d · ˆ n )ˆ n Multiply reflected ray’s light with the surface material colour.

  15. A Glass Marble What do we do with this material?

  16. Snell’s Law • Ratio of sines of angles is equal to ratio of velocities: sin θ sin φ = v = n t v t n

  17. n Material 1.0001 air 1.333 water Index of Refraction 1.47 olive oil of some common materials 1.52 crown glass 1.62 flint glass 2.15 cubic zirconia 2.42 diamond

  18. Ray Tracing Refraction n sin θ = n t sin φ cos 2 φ = 1 − n 2 (1 − cos 2 θ ) n 2 t t = n ( d + ˆ n cos θ ) − ˆ n cos φ n t

  19. A Diffuse Reflector M.C. Escher, 1946

  20. Three Spheres II M.C. Escher, 1946

  21. Properties of Diffuse Reflectors

  22. Diffuse Reflection • Brightness dependent only on the direction of incident light • View direction has no effect on appearance • Lambert’s cosine law: n · ˆ c ∝ ˆ l n · ˆ c = c r c l max(0 , ˆ l )

  23. Specular Highlights A Heuristic Approximation

  24. Moonlight Reflection What do you see in this picture?

  25. Plastic, Magnified [image from gelsight.com]

  26. Microfacet Geometry Model [images from Real-Time Rendering , A K Peters, 2008]

  27. Phong Lighting Model r = − l + 2( l · ˆ n )ˆ n r ) p c = c l max(0 , ˆ e · ˆ

  28. Blinn-Phong Lighting Model e + l ˆ h = || e + l || c = c l max(0 , ˆ n ) p h · ˆ

  29. p = 1 The Phong Exponent y = cos p θ p = 64

  30. Phong Highlights

  31. Summary: Types of Surface Reflectance • Ideal specular (mirror) reflection law - • Ideal diffuse (matte) Lambert’s law - • Specular (glossy) directional diffuse -

  32. What about ambient light?

  33. Indirect Lighting Material reflection works both ways!

  34. Global Illumination indirect direct combined Global illumination is really hard and expensive to compute!

  35. Ambient Light Approximated by a constant light source that represents the average indirect light energy in the scene. c = c r c a

  36. Our final heuristic shading equation… • with ambient, diffuse, and specular terms: ⌘ p ⇣ ⌘ ⇣ n · ˆ ˆ c = c r c a + c l max(0 , ˆ l ) + c l c p h · ˆ n c r is reflectance (diffuse) colour of material • c p is specular colour of material • p is Phong exponent, or shininess of material • c l is light source intensity (colour) • c a is ambient light intensity (colour) •

  37. Things to Remember • The appearance of a material is determined by the manner in which light is reflected from it • The Phong lighting equation approximates material colour, diffuse and specular reflection, and ambient light • Ideal specular reflection and refraction are relatively easy to achieve with ray tracing

Recommend


More recommend