Intro to Graphics 17 - The Rendering Equation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thank you all for joining another lecture for introduction to computer graphics we have been talking about shading last week we talked about shading in in general and we talked about phone material model and blend material model and we talked about smooth shading and how to interpolate normal so we can get smooth-looking surfaces out of our polynomial streams and we talked about how to handle all of those mathematical details and how to transform normals but today i would like to talk about the concept of shading in a in a more general in more general terms in the context of what is called in google graphics the the rendering equation so today we're going to be talking about the rendering equation now the what we went through what we talked about previously is sort of we took a little bit of a a similar journey to what phone and glenn and others took back in the days closer to the beginning of computer graphics when they were figuring out how to do shading and how to do rendering and things like that and they they figured all those out and you know that's the stuff that we covered last time but later on later on jim came home and came up with an equation and that's that he said this is the rendering equation and he said this is what we've been trying to do so he you put everything that people were doing in computer graphics in in mathematical terms and still today that very equation the rendering equation is the basis of all rendering done in computer graphics people extended this concept just slightly just a little bit but the rendering equation as it was as it was presented by jim crichia back in 1986 i'm not mistaken still still stays as it is and that's what we're going to explore today and well we'll understand and we'll hopefully understand now this is the random equation now if you haven't seen this previously this might look a little bit scary because the integral and all these funny symbols and whatnot but this is actually not scary at all when so at the end of this lecture you will understand this equation really well and and this will make perfect sense to you and this will actually hopefully improve your understanding of what rendering is and so that's going to be our goal for today and yeah if it looks scary for the time being don't worry that's that's that's normal but we'll uh we'll fix that so let's let's put this equation on the side and and let's make a look at images let's let's take a look at teapots they're much easier to look at right so you remember these two defaults we looked at them last time so this is a teapot with just diffuse reflections on it and this is a teapot with some specular reflections on it now i want you to look at this now forget about uh forget about phone shading or blend material model of foam material model forget about computer graphics for a second all right assume that these are actual physical real teapots all right i'm showing you this just imagine that they're real i know that don't look that realistic but for the time being try to imagine that they're real all right so if you look at them what do you see as the the difference between these two like the physical difference between these two what do you imagine when you look at them as as like the surface of these two objects when you look at this you should notice that yeah obviously this one is shiny this one is not shiny at all right this one is sort of made and this one is a lot shiny and that probably if you were to touch this if this was something real and if you were to touch this you would expect that you would feel some roughness on the surface of of this this one like if you were to put your hand over it it would probably feel a little rough and this one would probably feel kind of perfectly smooth almost right did you get that sensation i'm hoping that you do because actually this the material experience is very very important to us because we we infer a lot of information just by looking at things so getting this this material experience right is very important for us to be able to get get something realistic from computer graphics that then things looking exactly like we expect them to look and this looking like wood and this looking more like wood with some maybe protective coat on it so it's it it looks shiny right so this is you know it has no finish applied on it and this is like after we apply some finish that should should look more like that but we'll improve upon that just a little bit um so don't worry about it so let's get rid of this this shiny one let's take a look at this this one with a more like a rough surface a little bit so why does this look rough so let's um let's take a look at a piece of this surface i'm gonna highlight a little piece over here and then i'm gonna enlarge that piece so it's almost like flat right but if you zoom in a little bit let's take a little piece and extend it out you know what let's zoom in some more but let's imagine i did it a whole bunch of times and in the end i get a sort of zoomed in surface but the surface if it looks like this i don't expect the surface to look perfectly flat like this right i expect the surface if you were to zoom in enough i would expect the surface to look more rough like something more like this not not perfectly smooth and this is how if you were to put your hand over it you would feel some roughness and the reason why we can actually see this is because of how light reflects off of this surface so that's what we're going to look at today we're going to examine what would happen if i were to shine some light on a surface now now this is actually a very very complicated very complex process if you were to analyze the physics of this because you know if you zoom in and out you won't necessarily see a surface like when you want to see all these molecules and whatnot so but we're not going to get there we're not going to get to that that level also you know when you think about light lights you can think of them like you think of light as a bunch of photons going around or you can think of this as a wave right um so we're not going to talk about the the way behavior of light either so what i would like to accomplish today is just to get a more intuitive understanding of what's going on to the surface as opposed to giving you that the actual physical details as we understand it today of what happens when light hits the surface right so this is not a physics course that's not what we're trying to accomplish so i'm trying to give you a very simplified view of what happens to light when light hits the surface all right so i just want to put this as a disclaimer don't use what i'm explaining to you as the basis of uh you know any physical understanding of what exactly happens to to like when it hits the surface right all right so the simplifying view of this is i have some light beam coming to the surface and when i say light beam i mean some light rays coming all parallel uh well in this case in this direction and hitting the surface now because this surface is sort of rough when when these light rays coming in and hitting the surface we would expect them to scatter in all different directions and that's really coming from the fact that the surface is sort of rough so when when these this light beam hits the surface what we would expect to see is that the lightning would scatter something like this right it's the it's so chaotic it's scattering in all all over the place and this is really a reason why we would have this light scattering happening in in all directions now this is a very sort of zoomed in picture of this if you zoom out a little bit i cannot see these individual directions and and think about the fact that these imperfections on the surface are very very small and when i shine some light on the surface i'm hitting the surface with a really a very very large number of photons right and those photons will be bouncing off in all sorts of directions so statistically when you look at it and we should really look at it statistically you would see that light is bouncing off in all directions and if you have a perfectly diffused surface like this one then it won't matter from which direction you're looking at you're going to see the same color on the surface like whatever the color of the surface is so whatever the the spectral reflectance of this material is that's what i'm going to see regardless of which direction i'm looking at this surface and the reason why this is happening is that overall statistically the light beam that hits the surface is scattering in all directions sort of uniformly all right that's why it's happening now what we are using here is something like that we talked about this the version surfaces and this is like an inversion reflection is how this this particular image was rendered and the lamborghini reflect the inversion reflections assumes that you have your perfect reflectance profile the real materials are not exactly like that but it's not a bad approximation of what surfaces look like to us so it's it's actually a a fairly okay approximation of what what surfaces do do to it to a certain level of course but you know this picture of surface roughness and light scattering all over the place should give you some sort of understanding of why this is happening right that's that's that's the goal all right so what if it wasn't like this what if this surface as i zoomed in was perfectly flat now again it's things are not going to be perfectly flat but let's say it's almost perfectly flat so much so that even when i zoom in like this i can't quite see much like it still looks flat like what would happen to light that hits the surface in that case so light wouldn't scatter in all directions like this uh so we would get something more like this right so we would expect that the light to bounce off and and preserve its directionality of course this direction changes but at least it's it's reflecting uniformly okay let's say that that's how my surface is my surface is almost perfectly flat now why would my teapot look like that it wouldn't look like this right this would look it would look like this if the surface was rough if the surface isn't rough if the surface is like almost perfectly smooth in that case it will look shiny but how shiny actually it will look just shiny it will look like this now you see i'm i'm here here on the surface of the teapot i'm only seeing the reflections of the light sources that are hitting the surface because this is almost like a mirror and i'm not seeing anything else now of course this is this doesn't look quite like mirrors looks a little bit dark as you can see it doesn't look quite like mirror and the reason is that not all of the light is being reflected a part of the light is being absorbed right but all the reflections are happening in the perfect reflection direction so i can see the reflections of the light sources i can't see the reflections of much else well if you pay attention there's reflections of some some other things on the surface as well but mostly what i see is the reflection of the light sources that are eliminating the surface right so if the perfect if the surface is almost perfectly flat as you're doing if it's almost perfectly smooth you would get something something like this and so as i rotate this this object these shiny reflections will change their places on the surface right because based on how the surface normal is changing these reflections appear at different places these visible reflections appear at different places on the surface and and how dark the surface is is a function of two things in this case one is how much reflectance deserved how much reflectance this surface has that is it's not reflecting all of the light it's actually the light energy that's being reflected is sort of reduced so i can only see the very very bright things that are illuminating this so i can only see the light source and the other thing the other thing is of course the the amount of illumination i'm putting on onto this in the speedpod so if it's in a dark room with a few light sources i'm just seeing the reflections of these light sources right nonetheless i'm seeing the reflections of the light sources here okay but this is not exactly what i wanted to get what i wanted to get well my goal was to be able to get some shiny looking teapot like this right so it has some some diffuse like reflection i can see a recognizable color on the surface and i can also see these these specular highlights that are coming from almost perfect reflections that are changing places on the surface so i would like to get something like this so what would this look like so this means that i have a mixture of the two i have some light that's reflecting almost perfectly like this and i have some some light light rays hitting the surface are scattering sort of diffusely in all sorts of directions so i would expect to see something all like this right so as you see here these these blue ones are uh reflecting off of the surface specularly and these these other ones are reflecting in all sorts of different directions so what does this mean uh well this could mean a number of different things actually so this could mean that maybe my surface is not as smooth maybe it's a little rough maybe um well maybe not so much maybe it's it's more like you know parts of it is almost flat and parts of it is kind of rough maybe now we could produce something like this like a percentage of the the surface is almost perfectly flat as you can see here and some percentages it's kind of rough so we get you know both kind of reflections or more likely if i see a wooden surface like this what i would expect to see is that probably i had some rock wood and i put some protective coat on it right this protective coat when it dries up it's going to form a very smooth surface on top of that and that's going to be transparent transparent so light that's hitting this protective coat a part of it a portion of this light is going to reflect off of that surface and because this is this is really smooth i'm going to see perfect specular not perfect but almost perfect specular reflections on this for for the lights that reflects off of this this surface and a portion of the light is going to actually penetrate into this semi-transparent protective coat and the part that that goes into into this protective coat is going to defrock into it right and then it's going to bounce off of the surface of the actual wood in that case because the wood surface is rough it's going to scatter in all sort of various directions almost randomly and that we're going to see the reflections that will come out of the the semi-transparent surface and that will form this this diffuse reflection so when we look at an object like this that has some some diffuse and some specular reflections you know it could be all sorts of different things in this particular case you would probably expect something like this right okay so again let's uh compare compare these two teapots like so you see at the top i have my diffuse teapot and over here i have my dpc pot and some specular reflections on it now after all this description when you look at these two images these two teapots do you notice something wrong here now let me give you the parameters of what's going on here i have let's say i have the same t-wash i took this d-part and i put put some protective coating on the c-polish that i just painted over it with some protective coating uh just like the example i showed you a minute ago and so i'm expect i'm expecting to see some specular highlights coming off of that surface now and i'm eliminating both of them in the very same environment do you see something that doesn't quite look right with our understanding of how these specular reflections are forming the problem is with the diffuse reflections the specular reflections are they're okay but there's a problem with diffuse reflections in this case here's the thing in this case all of the light that's hitting the surface it is reflected off of the surface diffusely in all directions and we're seeing it in this case and the bottom case some of the light is reflected specularly above the surface some of the light is reflected specularly what does that mean that means the same light can not that portion of the light damage infected specularly cannot at the same time be reflected diffusely right so if a portion of the light is reflected specularly only the remaining portion can be reflected diffusely right so we can't have to have it both ways right so if i'm going to have some specular reflections on this surface that is going to come out of something i'm going to have to reduce the diffuse reflections so my teapot should look a little bit darker now right and this looks okay you can you can debate whether or not this looks more realistic but at least it fits our fits with our understanding of what what is happening to that surface right so we would expect this to look darker and that's exactly what happens in reality if you've ever tried this if you took a piece of wood and put some protective coating on it that you know the wood started looking shiny it will also look darker because of that so what's happening here is that as light hits this protective coating um a portion of that is going to reflect off and only the remaining portion can go into that protective coating and illuminate this this surface underneath the protective coating and only a portion of that will be reflecting off diffusing and we will be able to see it and and that's a very very important concept and that sort of brings us to this concept of energy conservation we don't want our materials to reflect more light than they receive i'm going to talk about this a number of times today because that's one of the main topics of our discussion for today so i'm going to repeat this we don't want our surfaces to be reflecting more light that they receive because that would be very unrealistic actually that causes a lot of problems in rendering if you're trying to do any kind of realistic rendering the surfaces can only reflect a portion of the light they receive and if they're reflecting more like it's it's like they become light editors right they become light sources and we don't necessarily want that unless the surface is fluorescent or something but that this is not a fluorescent teapot so anyhow uh let me get rid of this uh and show you this image so what we're trying to do is we're trying to do uh some sort of shading and when we're doing shading this is this is the setup that we got right we have some light hitting the surface and we are interested in knowing the color at this point more specifically the light that is reflected along this viewing direction that's what we are interested in and the surface definition how what's happening to the surface what exactly how exactly that surface is formed and or its microstructure if you will is going to determine what's going to happen here right and this can be a very very complex process involving you know light maybe uh going into the object a little bit in this case it's penetrating into this semi-transparent layer and bouncing off of the back but when i look at my t-pod image i don't quite see the protective layer in detail so much it's really like this layer is really thin so when we're not going to model this this extreme complexity of what's happening to that light source but what's important for us is to statistically statistically get this light reflectance distribution correctly that's what's important for us right if you can if you can get the statistics of how light is reflecting off of the surface then we're going to get a surface that looks like what we're trying to model right so that's that's the whole point so i'm going to replace all of this complexity with this one function this function that we call uh the bi-directional reflectance distribution distribution function so this function is going to give us the statistical distribution of how light bounces off of this surface again bi-directional reflectance distribution function or brdf so you you'll hear this this phrase the idf a lot from people talking about rendering because it's really really essential to to what we do in rendering this is a function that will tell me uh it's bi-directional because it's taking two directions right it's kind of taking the direction of incoming incoming light direction and the outgoing light direction the view direction if you will and this this function is going to return a value that will tell me what portion of that light is being reflected what portion of the incoming light in this omega direction is reflected along the given view direction so that's why we have these these two directions right and this this function determines the behavior of this material so this is our definition of how the material material behaves okay and for most materials this is a sufficient representation of what light does to that surface and if you have an accurate description of this function we can get very accurate renderings of that particular material for for most materials this is actually very very good so all we need is is this function again bi-directional reflectance distribution function the idea now i'm going to make some changes to our terminology here so to our notation here just a little bit and make it a little more more standard and then closer to how jingko gia defined these these terms in the rendered equation so i'm going to replace this term v and i'm going to sort of change the notation over here and i'm going to change the notation i here so notation is changing same figure different notation already ah this is what it looks like all right so now we have the incoming lights direction is represented as omega i and outgoing light direction is represented as omega o so this is for outgoing light it's incoming light and the incoming light the magnitude of the intensity radiance if you want to be more specific the incoming light is represented as l i and the outgoing light is represented as lo okay uh and of course the theta i put the same and i over here is theta i it's just associated with this light source uh this is a more standard representation of the the idf function so the idea is going to take two directions the incoming light direction and outgoing black direction is going to return us the amount of reflectance here now what is it what is this function going to return is it going to return us some scalar value some color value some what do you think so it really depends on what exactly it is that we're doing with our renderer so in general it can return a whole spectral value it can return a light spectrum and that tells you that the reflectance of this this material properly but at the very least we would probably expect this to return an rgb uh color value right and it tells us that the color of the reflected light so if it's if it's tinted and in any way and it might be right most surfaces will reflect their own colors but just for the sake of simplicity let's assume that it just returns a scalar uh so and you can think about this as a like it returns three scalars that corresponds to rgb colors or it returns a whole bunch of scales that corresponds to a whole light spectrum but just for simplicity let's assume for the time being that it just returns a scalar value right just imagine so imagine just one instance of of this brdf function where i'm going to keep this this input omega i the input direction i'm going to keep this constant so it is going to be this particular vector right so that means the light that's hitting the surface is coming in this direction right so what's going to happen to this light when it hits the surface it's the light is going to scatter in in all directions right it's been scattered in all directions but it's not going to scatter in all directions the same amount the this reflectance in different directions is going to vary right so i'm going to represent it as like this it hits the surface and in some directions i'm getting a lot of light think about this as the light intensity the the length of the vector think about this as the light intensity so a lot of the light is sort of reflecting in these directions and a portion of the light is reflecting in in other directions so this video function is going to tell me what percentage of the light is reflecting in what direction what percentage of the light coming in this particular direction is reflecting off of in all directions so my light can come from all directions of course and in the end it's going to scatter in all directions but over this this point this all directions we can think of this as like hemisphere over the surface uh and the hemisphere of all directions i'm gonna represent that hemisphere using this capital omega symbol right that's the hemisphere of all directions over all directions over this this surface now the important thing here is energy conservation let's let's think about energy conservation for a little bit so if i look at all light scattering in all directions over the same sphere if i look at all light you know if i just add all of that light i look at all of the continuous infinitely many directions over this hemisphere and i add all of that light well what do i mean i mean an integral like if i take an integral over this uh hemisphere capital omega an integral over this omega if i take an integral of that my the idf function over this omega for a particular omega i value for a particular incoming like direction right i'm only integrating over all possible outgoing light directions okay what am i going to get let's say that my b idf returns something some scalar value if i integrate my bidf what am i going to get am i going to get the reflected lights i'm not going to get the reflected light because i'm not saying how much light is hitting the surface i'm telling you the incoming light direction which is omega i but i'm not telling you how much light is coming to that surface so my prdf is only telling me the percentage of light that is reflecting off of each one of these um omega-0 directions so if i take the integral over the entire hemisphere over the whole the entire possibility of where the reflected light can go it should always be smaller than or equal to one right because if it is greater than one that means if i sum all the reflected lights all the reflected light is going to sum up to something greater than the incoming light if it is greater than one it can be one in theory that means the surface is reflecting all of the light that it receives it's absorbing nothing uh that would be a very interesting material right if it's reflecting all of the light that could be a very very useful material unfortunately not a very realistic material so we would expect real materials to absorb some of the light you know you're going to lose some energy with this whole reflectance so some light is going to be absorbed some light is going to be reflected so in in general we would expect this to be smaller than one right so this is a measure of what percentage of the light is reflecting so this is this can't be hundred percent it can that cannot be greater than 100 so it cannot be greater than one that's that's the idea right and we typically represent the idf we draw it as a function over this uh to represent how much light is what percentage of the light is being reflected for each given direction right instead of drawing these you know arrows in all directions we typically represent a curve around this reflected surface to to represent the the idea uh and if i get rid of these reflections there are errors so this is what the the audio function looks like right so there's an incoming light direction omega i i'm fixing it i'm fixing it for for this and for this omega i uh in this 2d cross section i am getting the vrdf shape that looks like this of course if i change if i change this direction incoming light the the shape of this function is going to change as well right so if if the light direction is something different i'm going to get a function that looks a little bit different so the idf is not just the function of the outgoing direction it's a function of both incoming and outward direction so i can in 3d i can represent an incoming direction and in two dimensions yeah it's a 3d vector but it's a unit vector so it only has two dimensions actually so you can think of this incoming light direction being two dimensions and outcoming light direction being two dimensions uh it's a position on the hemisphere both of them are positions or hands here so this is brdm is more like a four dimensional function like two dimensions from this two dimensions from that it's a four dimensional function that returns either a scalar or a color value or a color spectrum or light spectrum depending on how we're modeling rbif but of course it depends on uh so this this is just one instance of this this cross section into the cross section of what the idf would look like for this particular incoming light direction omega i and of course if i change that on my eye to something else then the idf shape is going to deform accordingly a lot of times so when we're doing blend shading for example when we're doing blend material we're not generating this entire function right what we want what we're interested in is just one value for from this function that one value is the value that corresponds to our outgoing direction so we are just interested in this one value here and that's what we're trying to compute when we're doing shading so i have my incoming light direction and outgoing light direction and i'm going to feed it in my video and my drdf is going to is going to give me the the output so that's that's all i'm interested in i just want to evaluate it in one instance for incoming and outgoing like directions uh in most cases anyway so this incoming direction will be associated with the incoming lights li and outgoing direction uh i will use it for computing the output like lo here right so before we continue i want to tell you that drds have a very interesting property so this is the audio function i'm writing two instances of it there's a good reason for it because i'm going to take this one and i'm going to switch its its inputs right if i move them around i'm going to tell you that these are equal so this is happening because of the the properties of how light interacts with surfaces and the whole geometry of what happens here so this doesn't mean that i'm getting the same function that looks the same with the same the omega o and omega i that that's not what it means but if i give you a a pair of input and outgoing directions and if i switch the order my brdf is going to produce exactly the same value that means i can think of light as light that comes from a light source hits the surface and comes to the camera or i can when i'm doing rendering i can do the exact opposite i can strike from the camera and move from camera and go towards the light sources uh geometrically it's the same behavior the light behavior is equivalent or i can think of this as like i could switch the order of my camera and the light source like this yeah the incoming angle is different and what not but my pidf is going to produce the the same value that it's all related to how light interacts with with surfaces right so either way it gives you the same value that's an interesting property of of of the ibs but what i'm interested in actually is computing this reflected light source right objective light this is what i'm interested in that's what i need the idea for so all i want to know is this outgoing light in this particular direction it's typical to write this as a function of as deflected like hello as a function of the reflected light direction because obviously the reflected light is going to vary if i change my camera position if i look at it from a different direction and i might get a different value right so the reflectance is not going to be the same not necessarily going to be the same right so this is what i want to find out now we talked about how to do shading so you guys should have an idea about what to do here so what do we do here to compute this outgoing reflected light we're going to take the the incoming light right the incoming lights whatever that is and we're going to do our well if we're doing uh uh we're using a blend material we're gonna do you know use our blend material formulation and we're gonna figure out how much light is reflecting in along this direction right so the incoming light is going to be this term here right so the lights incoming lights li along this incoming direction omega i multiplied by the cosine term the geometry term remember the geometry term we talked about this extensively and why it exists now this is this whole thing is just just the incoming weight and i'm going to multiply that with my surface vldf and i multiply that with my surface vidf that's going to give me that's going to give me the reflected light along along this direction and this is exactly what we have been doing when we talked about the foam material model and then the blend material model remember i talked about this cosine theta term being outside of the material definition this is what i was trying to talk about so back when foam came up with his material model and then blend came out with his material model this this concept of rendering equation was was not there yet so this cosine term was sort of implicitly included in the material definition back then that's why if you google the phone material model or blend material model you may not see this this cosine theta term as something that's outside of the material definition you may actually see it as inside of this material definition you may see this cosine term as a part of the diffuse term because this whole concept of random equation came about much later and we we put this cosine term outside of this material definition the idf definition outside uh inside of the material definition later on so historically it was not in there but this is a more proper way of writing everything okay so this is what happens if i have just one light source and the light is coming from this omega i direction what if i don't have one light source but i have a whole bunch of light sources what do i do now now we talked about this briefly last time if you will remember in this case light is coming from a whole bunch of directions and by the property of lights i am just going to add them right so the reflected light along this direction is going to be the sum of all light hitting this point from all of these light sources and all of them reflecting in this particular uh omega o direction so i can write it as a sum like this right sum over all i uh now i'm going to do a sum over all light sources and i'm going to find out how much light is coming from the light sources along this their light directions and i'm going to also buy them of course by their own geometry term theta eye that's the reason why i put an i here when i wrote theta i didn't leave it beta all right so if i have a whole bunch of light sources i am going to do a sound like this simple enough simple enough right this is exactly what we've been doing we're just uh doing multiple light sources right but in general light is not just coming from a few light sources in in reality when you look at a surface and we're trying to imitate reality in computer graphics to be able to produce realistic looking images in reality when you look at the surface light comes from all directions so there's there's sunlight coming from from all directions i'm going to revisit this this concept later on but in a realistic environment there is some light that's going to be coming from from all directions so you can really think of this as as light coming from all over this hemisphere the hemisphere represented with this capital omega symbol if the light is coming from all directions then we can really think of this instead of a a sound form you know a finite number of directions where i have light sources i can think of this as like an integral over this entire hemisphere surface i integral over the entire hemisphere omega that defines all of my omega i incoming light directions and i'm going to find out light coming from all directions and i'm going to do an integral over all directions and i'm going to you know for each direction i'm going to multiply it by its cosine term and my vibf and that is going to give me my reflected reflected light in this reflected direction and now this if you recognize is the rendering equation so that's what jim cartey had defined as the rendering equation and said this is exactly what we've been trying to do and then he came up with a very good method for for computing this for more realistic light simulation and we'll we'll talk about that stuff later but for today i want to concentrate more on the the idea term over here so we're going to talk about how to compute this this incoming light and that's going to be very very important especially computing incoming life from all directions is going to be very very important for for generating realistic looking images and this requires doing a realistic light simulation so we get this term right so if you get this term right and if you have a realistic material model here representing our b idf and if we can actually compute this integral with sufficient accuracy that's when we're going to get very very realistic looking images that's when we're going to get lifelike computer graphics images that will be very very difficult to differentiate from reality so that's this equation summarizes what goes on in rendering all right so let's uh try to remember what we did before we talked about the blend foam material model blend material model and foam material model and they both looked very much like this right so i can write the blank foam material models as like a video formulation like this so the diffuse term is just a constant term right so no cosine here cosine is out there it's not inside of the rdf i keep saying the same thing because ah when you when you google this you're gonna you're gonna find this cosine term right next to this this is not the right place to put the cosine term okay the cosine term is outside so this is the idf this cosine i have a constant cosine term like a constant diffuse term and a specular term that's uh defined by this formula and i'm dividing it by this this cosine theta i that's how blend and form material models are both defined so if i were to draw this reflectance over here what do i see so i see that this term this constant diffuse term as a just a constant value right so it's just a a constant value over over these all possible directions of limits here and the specular term the speculator is going to you know it's again sort of cosine shaped but it's to an exponent and depends on depending on the the value of this exponent it's going to take a sort of huge change of course this particular direction that i picked here that corresponds to a particular incoming light direction right so based on this incoming light direction i'm gonna have a specular term over here and that specular term will change its its place based on where my incoming light direction is right so when you look at this brdf as a function of how light reflects off of the surface you see that this is a very very crude way of representing what could happen right so when you think about this as like oh having a very complex surface and from this this complex surface i have light reflectances in all directions and i have this statistical distributions of light reflectance in all different directions this is a very crude way of representing this this really complicated function and this really complicated light reflectance behavior i had just one constant term and just one bump and and you know depending on how you set these parameters it might look okay but when you put it in this picture i think it sort of makes it very clear how simple this this blindfold material model is right so you shouldn't expect it to produce some really realistic looking materials even though it actually works okay in a lot of cases um another thing that i would like you to to recognize here is that a lot of times people look at blood and phone it's not a physically based material model yes but um they say that it's not energy conserving and that is true but i would say it's not necessarily energy conserving for example the particular parameters for the diffuse reflectance and specular reflectance that i asked you to implement in the uh the upcoming projects well the project that you guys are implementing or have already implemented the particular parameters that i suggested in the project project description would produce a very unrealistic material model because i said this is going to be white that is one one one this is going to be white one one one that means i'm reflecting all of the light diffusely which is on itself ridiculous because if it is one one one coming out of all directions even the diffuse reflectance itself just diffusified forget about specular just reviews the deflections itself is going to reflect more light than it receives really yeah it really does because if i take an integral over the entire hemisphere the integral of the entire hemisphere uh i just have this diffuse value it's constant one one one what i'm going to get is going to be the area of my hemisphere right and the area of the hemisphere is what all right area our unit unit time sphere is yes so we're going to get this 2 pi term but we have this cosine term here multiply by this this cosine term if you include this cosine term you will see that we're going to have a pi term in there to be able to normalize this diffuse reflectance so just putting just putting 1 1 1 as the diffuse reflectance is going to produce too much reflectance off of this surface all right all right so let's say that we we scaled it down we kind of need to be careful about this specular reflectance term as well and in this case it depends on what this this exponent the shininess parameter here this exponent alpha is as well as this alpha gets smaller and smaller and smaller then this reflectance area is going to get larger and larger the specular reflectance area is going to be larger and larger that means i'm going to be specular reflectors over a larger area over the hemisphere so i need to pick a smaller and smaller reflectance for this specular component here but when my alpha is larger and larger i have shyness value that's that's closer to infinity then i'm going to have a very sharp spike at one point at not maybe one point but maybe shiny spike at close to one point here goes to one direction one perfect reflection direction so my specular reflection coefficient here can can get larger right if you want to have an energy conserving material a material that does not reflect more light than your machines you kind of need to be careful about how you set this this diffuse and specular components and how we set the specular component will depend on how you set this exponent alpha right and so a lot of times actually in some applications people will tie the value of the specular constant here to the value of this exponent so as you change the the value of the shine in this parameter that software might automatically scale this value so as as you get a wider specular low everything is going to be lower and if you have a sharper speckle though you can have a stronger specular reflection with a larger magnitude and of course you know that some if some light if light is reflecting diffusely that means it's not reflecting spectacularly so you kind of need to be careful about how you set the two of them together so there's some work on energy conservation how you handle blend and foam materials so you get energy conserving materials but i'm not going to get into that but i just wanted to give you the general idea of why this is then well we're going to talk about why this is an important thing but at the moment i'm just telling you that this is an important thing because we don't want materials to be reflecting more light than they receive all right but nonetheless this is a very very simple material model with a very very simple shape in reality like we have all bunch of material models in computer graphics and there are different different considerations when you come up with a material model your material model is going to have some parameters so you can represent different types of materials so if you find this too crude and not realistic enough you'll probably have more parameters to to adjust for a more realistic material model and probably the function is going to be more complicated than these simple call signs so it's it could be a more complicated mathematical function and in the end is that going to be realistic how realistic it's going to be it's going to depend on what kind of model you use for generating your video function right so the best thing we can do if you want to get a very realistic looking image what we can do is that we can just measure this so i can just uh shine a light on a surface for all directions and then i measure the reflected light for for all directions and i can actually measure the value of of this brdr function i will show you some examples rendered using measured pidfs so uh this this funny shape i don't even know what it is but it's an interesting looking smooth shape it's eliminated by some we talked we talked about this image-based lighting right so it's eliminated by an environment map that's light is coming from all directions with different magnitudes defined by an image and uh the right reflectance computed on these surfaces are coming from some measured pidf models so you can think of this as like a tabulated values for this this 4d function for the function being to be on the f and there are different ways of tabulating these values different material databases they represent their materials differently so this is showing some some renderings of the different materials so these may or may not look very realistic to you but at least these materials look exactly like what they're supposed to look like if they were observed under this this particular elimination another thing that you should consider is that if you look at the blend and following material models those are what we call isotropic material models so that the specular term is is not going to vary too much depending on from from which directions you're you're looking at the surface so we say we're defining them based on the the directions of incoming light and outgoing light but as we rotate incoming light and outgoing right lights directions along the around the surface normal we might get different reflectance properties for different materials so some materials look isotropic like like this example over here and some materials look very isotropic so the it's almost like this this specular term changes as you take the object and rotate it so some materials will be unisotropic and that then the specular reflections specular highlight on that surface will change its shape accordingly because of this anisotropy now i'm going to show you some examples here some different material models these are rendered using a compact representation of some measured material models under an environment elimination like this different material models and the reason why i picked these particular images from from this paper here the video of this paper here is that see like this is a very isotropic uh material so as the light rotates and and the surface is eliminated from different directions that it's not just the specular reflections change their places but they're also the shape changes quite an edge right so you see this this plate has some very isotropic uh specular reflection profile uh and we have um analytical models for representing such isotropic materials uh but we also have measured brdfs that um that represent this this isotropic behavior of the material model so in that case the reflectance does not only depend on the surface normal but also how the the the surface is oriented around that surface normal so you get the analyzer drumming direction uh correctly so that shading becomes a bit more complicated for for those materials all right so this is what i plan to talk about for today just to give you guys a general idea of what rendering is and what rendering equation is next time around we can continue talking about rendering all right then i'll uh i'll end it here thank you all for joining us and i'll see you all next time
Info
Channel: Cem Yuksel
Views: 1,971
Rating: undefined out of 5
Keywords:
Id: GOfzX7kRwys
Channel Id: undefined
Length: 59min 27sec (3567 seconds)
Published: Wed Oct 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.