week 9 - monday. what did we talk about last time? brdfs texture mapping and bump mapping in...
TRANSCRIPT
![Page 1: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/1.jpg)
CS361Week 9 - Monday
![Page 2: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/2.jpg)
Last time
What did we talk about last time? BRDFs Texture mapping and bump mapping
in shaders
![Page 3: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/3.jpg)
Questions?
![Page 4: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/4.jpg)
Project 3
![Page 5: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/5.jpg)
Choosing BRDFs
![Page 6: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/6.jpg)
Fresnel reflectance
Fresnel reflectance is an ideal mathematical description of how perfectly smooth materials reflect light
The angle of reflection is the same as the angle of incidence and can be computed:
The transmitted (visible) radiance Lt is based on the Fresnel reflectance and the angle of refraction of light into the material:
it
iiFt L
θθ
θRL 2
2
sinsin
))(1(
lnlnr )(2i
![Page 7: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/7.jpg)
Snell's Law
The angle of refraction into the material is related to the angle of incidence and the refractive indexes of the materials below the interface and above the interface:
We can combine this identity with the previous equation:
)sin()sin( 21 ti θnθn
iiFt Lnn
θRL 21
22))(1(
![Page 8: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/8.jpg)
Fresnel example
![Page 9: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/9.jpg)
External reflection
Reflectance is obviously dependent on angle Perpendicular (0°) gives
essentially the specular color of the material
Higher angles will become more reflective
The function RF(θi) is also dependent on material (and the light color)
![Page 10: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/10.jpg)
Approximating reflection
Because it's non-linear, Schlick gives an approximation that works for most substances:
We can use a table of RF(0°) values
5)cos1))(0(1()0()( iFFiF θRRθR
![Page 11: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/11.jpg)
Internal reflection
External reflection needs to be modeled more often than internal reflection
Modeling internal reflection is the same except that the higher optical density can cause total internal reflection
![Page 12: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/12.jpg)
Diffuse light
Usually is not as complex as specular light We can measure a value ρ that gives the ratio
between light escaping a surface relative to light entering a surface
ρ is called the scattering albedo Because of conversation of energy, the more
light that is reflected through Fresnel reflection, the less there is to be reflected diffusely
Thus, a simple approximation for diffuse light is
πρ
θRf iF ))(1(),(diff vl
![Page 13: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/13.jpg)
Microgeometry
![Page 14: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/14.jpg)
Microgeometry
The cause of many lighting effects is microgeometry The smoother the surface, the tighter (and brighter) the
reflections are
![Page 15: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/15.jpg)
Weird effects
Glancing angles can minimize the impacts of surface roughness, making rough surfaces reflective at very high angles
Most surfaces are isotropic (symmetrical) in the way they are rough
Anisotropic surfaces like brushed metal have directional blurring
![Page 16: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/16.jpg)
Implementing BRDFs
![Page 17: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/17.jpg)
Where do BRDFs come from?
The book gives a number of BRDF equations
It is also possible to samples materials (from every angle, at every color of light) to measure a BRDF of your own
Once you've got such a model, how do you implement it?
![Page 18: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/18.jpg)
Implementation
The shader will use the following equation:
The cosine term is found with the dot product Most BRDFs contain a 1/π term Many systems pre-divide EL by π
Make sure you don't double divide (or double multiply)
If some value is computed repeatedly, consider putting it in a texture for lookup
Mipmapping may not work for non-linear BRDFs
kiL
n
kko EfL θcos),()(
1
vlv
![Page 19: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/19.jpg)
Optimizations
It may be expensive to compute the shading based on all the light sources
Also, many APIs (and various graphics cards) limit the number of light sources
Some lights must be averaged into each other for performance reasons
![Page 20: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/20.jpg)
Deferred shading
Shading is usually done while z-buffer testing is done
It's possible to do all the z-buffer testing and then go back and shade only those fragments that contribute to the final scene
![Page 21: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/21.jpg)
The Other Side of the Fence
![Page 22: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/22.jpg)
Image based rendering
A great deal of graphics research deals with rendering real scenes Don't cameras do that?
Sure, but these graphics guys couldn't publish papers if the stuff wasn't hard for some reason: Reconstructing novel viewpoints Walkthroughs with user controlled paths Introducing synthetic objects into real scenes Re-lighting real scenes with new light sources
I would be remiss if I didn't mention these topics even though they usually have nothing to do with video games and often cannot be rendered in real time
![Page 23: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/23.jpg)
Plenoptic function
A central idea in image-based rendering is the plenoptic function, sometimes called a light field
The basic plenoptic function is and its result is a color In other words, it tells you the color you would
see if you were at and looked in the direction given by angles and
There are also more complicated plenoptic functions that take into account time, wavelength, and more
![Page 24: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/24.jpg)
Sea of Images
Although the research is old now, Daniel Aliaga et al. produced an impressive system for recreating real scenes in real time in which a user can control the path he or she takes
A robot records thousands and thousands of omnidirectional images and its location when it takes them
Then, images are merged together to create a novel view for the current location and orientation
![Page 25: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/25.jpg)
Sea of Images issues
Rendering the images in real time isn't hard Knowing the robot's position for all images is
surprisingly difficult Storing and loading the next images that will
be needed in reconstruction is a huge caching and compression problem
Getting the robot to walk around and scan a scene automatically ended up being too hard
Some of these ideas were used for Google Street View, which is neither real time nor allows for arbitrary locations
![Page 26: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/26.jpg)
Sea of Images Video
![Page 27: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/27.jpg)
Image based lighting
Synthetic objects can be rendered using a BRDF based on measurements of real-world materials
Alternatively, we could sample a real-world object from many different directions and get enough information to re-light it
You can also capture lighting from the real world using a mirrored ball
Then you can re-light: A real image with a different set of real lights Synthetic objects with realistic real light
![Page 28: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/28.jpg)
Image Based Lighting Video
![Page 29: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/29.jpg)
Upcoming
![Page 30: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/30.jpg)
Next time…
Area lighting Environment mapping
![Page 31: Week 9 - Monday. What did we talk about last time? BRDFs Texture mapping and bump mapping in shaders](https://reader030.vdocuments.mx/reader030/viewer/2022032517/56649c9b5503460f94958bc6/html5/thumbnails/31.jpg)
Reminders
Work on Assignment 4 Due this Friday, March 20
Start working on Project 3 Due April 2
Keep reading Chapter 8