How physically based, photometric lighting can improve 3D renders + FREE Blender addons for it

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I'm creating a course called the fundamentals of digital lighting and it's for beginners so I assume it's going to be a breeze to create when it comes to lights it's mainly just the size the color and the strength and each of those are fairly self-explanatory but I was in the middle of recording a lesson on how bright to set your lights when I realized that I don't actually know I've always gone just by eyeballing it and going with whatever seems right at the time but even after doing that for years I still sometimes end up with results that don't really make sense so I took a step back from that and did a little bit of research and tried something new I'm Jonathan lamb pile with CG cookie calm and today I want to show you a new method of lighting your scenes using principles from photo metrics and radio metrics which are the two sciences of measuring light that'll help you get more consistent and believable results from your renders and at the end I'll show you two free add-ons that you can use for photometric lights inside of blender but first let's go over what the main problems are and how you can solve them on your own if you want to the first unintuitive fact is that the strength of a light changes the apparent scale of a scene we know that the scale of light changes how a softer sharp the shadows that casts are because the larger it is the more rays from one side of the light will hit a spot that rays from the other side can't reach so if we're setting a light size to a somewhat accurate value will help a lot if the rest of your scene is to scale with the real world but it's less obvious that brightness has a similar effect you see light follows the inverse square law when it's being emitted in all directions which states that the amount of light hitting a surface decreases in proportion with the square of its distance from the source it's not linear it's a very specific curve if we scale up a room five times one way to tell that it's bigger is by observing the fall-off of the light in order to make the light look correct again we'd need to square the number we scaled the room up by and multiply that with the original light's strength now this larger room looks identical to the smaller one and nobody can tell that it's the wrong scale but you can imagine that if we're just guessing about how bright to set the light we can very easily make the room look too large or too small totally by accident it's not something we'd notice right away but it can subconsciously tip us off to the fact that something is faked so assuming that we have the lights set to the correct brightness we can make our renders look brighter or darker by adjusting the exposure instead not the brightness of our lights this doesn't actually matter when you only one type of light though since it's all relative to that single source but when you have two or more types of lights this really comes into play the second thing is that our eyes can adjust to a really wide range of environments so we generally don't think about just how big the difference can be between different light sources if we're sleeping and somebody turns the light on it might feel like an atomic bomb has just gone off in the middle of our room but if it's a sunny day and lights coming in through the window flipping on that same switch might make a totally negligible difference and you might not even notice that song so what we experienced isn't generally the brightness of a light but really it's change in brightness over time and it seems pretty intuitive to us but it's not something we generally think about when we're lighting our digital scenes take a look at this classroom as an example it looks believable right yeah it's a solid render but hold on why on earth are the lamps on the ceiling brighter than the Sun in a photo of a similar situation even if it's not exactly the same you definitely still be able to see the reflections and shading of the fixture even on a dark and cloudy Seattle day taking a picture of a light bulb that's on with my exposure set to focus on the outside I can totally see the color and even the writing that's on it the real world is just a lot more extreme than we experience it to be because we adapt so well our intuitions about objective light values can be a bit deceiving so we know that this strength we set our lights at relative to each other matters a lot but how do we know what values those should be blenders light units are watts and this light bulb here is also measured in watts it on the front of it it says 45 watts so you'd think that if I plug that into blender sent to the same radius and same color then we'd get an exact match but unfortunately that's not really the case you see there's two different measurements going on and they both use watts as a unit this bulb is listing the amount of electrical watts needed to power it on while blender is calculating how many watts are being emitted as light also known as radiant flux since this incandescent light bulb is not that efficient only a fraction of the input watts are turning into visible light while the rest is turning to heat to make things more confusing other light bulbs like CFLs or LEDs will list a watt equivalent which is the amount of energy it would hypothetically use if it were an incandescent bulb so that's neither the amount of energy it's using nor the amount of light that it's putting out what most commercial lights are measured in however is lumens because watts of energy needed doesn't necessarily say anything helpful about how bright the light is lumens actually measure how much light is perceived to the human eye as being emitted from the source so if we could just find a way to plug lumens into blender's wasps and convert them then we'd have a realistically consistent and a physically based way of lighting and blender and since we're humans we want to know how bright something appears to be should be perfect but here's where things get a little bit weird notice how I said appears to the human eye the problem here is that different colors of the same value appear to us as different brightnesses I'll keep this value here at one but as I shift from green to blue everything appears to get darker red is a bit brighter but still a little dark and green is the brightest if you've ever run into the frustration of trying to make something really colorful but also really bright or even consistently bright between colors I feel your pain the problem isn't with the computer or with physics though it's with our eyeballs we're just better at detecting some wavelengths of light than others so in order to convert lumens to Watson an RGB system we need to first get the spectral distribution of the light separate the red green and blue multiplied by the luminous efficacy of each add them back together multiplied by the maximum possible efficacy and use that to divide the input number of lumens by in order to get the correct watts output here's the full equation if you're curious now not only can we plug in lumens and get the right power output we can also change the color of our light without changing apparent brightness that's super cool doing this isn't necessarily all that realistic since a color LED bulb isn't going to magically get more energy when it changes color but it sure is fun to break the rules sometimes once you know what they are if you want to accurately simulate an RGB bulb unplug this part here and use the value 683 instead which is the maximum luminous efficacy and how the bulbs lumens are recorded by the manufacturer speaking of color though remember how orange this photo of an incandescent light bulb looks well to my naked eye it looks pretty white maybe even a little warm but not quite that colourful well just like how our eyes just a brightness they can also adjust to a range of colours to measure the color of a naturally produced light source we use what's called a Kelvin value which is the color that a totally neutral substance called a blackbody emits when heated to that Kelvin temperature our eyes are so well adjusted to these colors that we can perceive any of them as being white if we don't have any other color of light to compare them with it's pretty easy to plug Kelvin values into cycles lights using a blackbody node a candle starts at around 1800 incandescent bulbs are usually around 2700 fluorescent lights vary around 3 to 4,000 ish direct Sun is around 5,000 give or take and a clear sky can be about 6500 by colouring your lights using Kelvin values they'll be a bit more believable especially when you have more than one type of light in your scene that you'll be comparing them with the Sun was a lot easier to find values for since its unit in blender is watts per square meter and that's more of a common unit that we can look up depending on the time of day and atmospheric conditions though it can go from anywhere between 250 for an overcast day to over a thousand for direct sunlight that's a way brighter than I was expecting it's also really interesting to note that even in the official Pixar documentation they talked about bringing down the strength of the Sun to make it fit within a normal dynamic range so you're in good company if you want to do that but maybe set your mental reference points at zero in 2000 instead of zero and 10 which is blenders soft maximum that's just too dim regardless obviously remembering and setting all of these values every time you make a new render would be a huge hassle which is why not that many people do it I started out on this project to make things easier for beginners not more confusing so I wrote a plugin called extra lights which does all the work for you I looked up all of the exact dimensions color temperatures and lumens of a bunch of real-world lights by digging through many thrilling technical PDFs with tiny tiny fonts and found the right values for a ton of common light fixtures and you can add them to any scene just by pressing shift a you'll find everything from a candle to a living room lamp bulb to a fluorescent tube to an outdoor floodlight because evey lights can't use nodes yet I've done in lumens to watts conversion and a Kelvin temperature to RGB conversion in Python so that you can use these in evey as well I've also conserved the energy and spot lights so the gets focused when you tighten the beam a couple other features that I added for fun include automatically creating a sky texture that's linked to the sun's rotation because I've always thought that that should be easier setting the camera's exposure based on the newly created light and adding a bunch of IES lights that create realistic patterns corresponding to the bulb and light fixture that it would normally be found in now you'd think that IES files since they're supposed to be based on carefully constructed scientific data would inherently be the right strength but the ones that I found online at least the ones that I can legally use a distribute we're pretty mangled this one is for a tiny outdoor path light while this one is for a crazy bright theater spotlight the data is normalized using who-knows-what formula and the names are vague and unhelpful so I dug drill the files found the lights that they're actually based on and matched them with how bright the original manufacturer or Home Depot said they should be as well as gave them the correct size and color temperature when you first add some of these lights it may seem like they're a little underpowered but let's look at blenders default setup though based on what we've just learned the cube that I always kind of thought was the size of a box is actually 2 meters or about six-and-a-half feet tall default lamp is emitting more than 5 football field stadium giant LEDs and the default Sun is about as bright as a car headlight or maybe slightly more so no wonder runners using the default values usually seem a bit off because the defaults are kind of wack it's set up so that things are properly exposed if you only use one type of light but what are the chances of that this typical of this add-on is to make your new defaults make sense you can get this add-on for free using the github link below if you're interested in supporting this and helping me make other projects like this in the future I've also added it to the blender market and CG cookie and that one comes with 30 regular lights and 30 IES lights so if presets are your thing I think you'll find it helpful I'd also like to share the work of Fabian the developer behind the add-ons photographer and light pack he helped me out a little bit with this project shared his code with me and answered some of my questions I'd highly recommend getting the photographer add-on especially it adds all of the functionality of a real camera to blender's cameras such as setting the exposure in v's changing the white balance using auto focus and a whole lot more as a side benefit and confirmation that we're on the right track our light values match so adding my son preset to the scene and using the photographer's Sonny sixteen rule of thumb actually works he's also got a physical lights update coming soon that lets you use lumens and Kelvin values right in blenders light properties in cycles and evey which is extremely convenient it's free but I'd recommend throwing in a couple bucks as a donation because it's really well-made also thanks to Troy Sobotka for answering a bunch of other questions that I had along the way with all that said I do want to make sure that I'm clear about two things the first is that while we're getting these values from information from the real world they're not necessarily going to be totally accurate that's because we're making a lot of assumptions about the aluminum alleys that we find online and how those manufacturers got those numbers in the first place and what kind of conversions they used in things like that so while I'll call this method physically based or even photorealistic because I think the results are I'm not going to call it physically accurate because there's just not enough data readily available to us in order to get there secondly and maybe most importantly do you have to use real-world lights in order to light your scene even if they could be a hundred percent accurate no of course not if computer graphics isn't about bending the laws of physics to your whim in order to make look cool then I don't know what it's for reality doesn't always match our ridiculous expectations which is why film studios use just ridiculously bright lights that don't match reality whatsoever painters have been messing with the properties of light on purpose for hundreds of years and we all know the moon doesn't actually illuminate scenes like this however it's better to start with something based in reality and then break the rules of thumb intentionally when you want to be creative rather than by accident and the other way around so that's all I've got on the topic I hope you found it well illuminating can cook have one or both of those add-ons in the links below and subscribe if you wanna be the first to hear about the fundamentals of digital lighting course that's coming out soon till then stay healthy and safe peace
Info
Channel: CG Cookie
Views: 88,843
Rating: 4.9694657 out of 5
Keywords: blender, tutorial, blender tutorial, cg cookie, blender 2.8, blender how to, lumens, candelas, lux, light, lighting, radiometric, photometric, jonathan lampel, kelvin, color temperature, cycles, eevee, addon, plugin, blender market
Id: ipqyVWm5JmY
Channel Id: undefined
Length: 12min 57sec (777 seconds)
Published: Tue Apr 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.