 Okay, I think it's 10, so let's get started. I have a lot of slides, so I probably shouldn't wait too long Welcome to my presentation on the new principle PSDF model and cycles A more accurate title would be the upcoming new principle PSDF model and cycles But when I submitted the talk I thought it would be done by now. So yeah, just It's coming soon more than later First of all a quick overview. What's going on in this talk a quick introduction then Why even a new principle PSDF? What's wrong with the current one or rather? What could be better with the current one then some quick theory on shading? What's even going on? What are we trying to do and then finally the components of the new principle? Principle PSDF principle to be to what I'm calling it in development. Definitely not the final name and Then at the end what is the current state? What's going on? When can we expect it expect to see it? So yeah, let's get going First of all who's talking to you. Hi, Lucas Stockner here I've been working on Blender and specifically cycles for eight years by now crazy out-time flies Some things you might know that I've done like light portals multi scattering GTX Monday later the old denoiser before the AI took over The IS lighting you don't support AOV passes and a lot of internal stuff that users don't really care about I've worked with some studios before that use Blender and also just directly as a hobby, but Nowadays, I'm actually also working through the development fund directly on Blender. So that's awesome I'm also still in universities still studying computational science and engineering Masters almost done, but not quite and I'm also part-time at Genesis Cloud still So the point of this talk already mentioned it on the one hand I want to talk about this new principle PSDF model in particular What's the current plan? What's the current state and also a bit of like not really documentation But just something to maybe point people to say hey, this is these were some of the background decisions If you want to know why things were done this way here's the slides and also on the other hand Some might remember in 2019 I did a talk about Cycles internals what is a rendering engine even doing and so on so this is basically a follow-up to that on more background information on shading No worries if you've not seen it. This is completely separate and I don't expect you to know the entire last talk Also throughout the talk. I've got references at the bottom I don't think you'll be able to read it here in the presentation But later when the slides are online if you're interested in some backgrounds and paper something that's mentioned just you can check it out there So why a new principle PSDF? Fiscal-based shading and cycles is an interesting topic Physically based as a term is gets thrown around a lot and people mean different things by it You could mean it on the one hand in a sense of just it's based on physical theory Instead of just writing a renderer that produces images to kind of look nice You write a renderer it uses the accurate images in that sense cycles has always been physically based because well It's a path to Acer Often especially as a buzzword. I would say it's used in a to mean a very specific type of shading that comes mostly out of the Game world even where you have, you know, your specular texture and your metallic texture and your roughness texture and so on so This in this sense the principle PSDF is both of these things Before 2017 Physically-based shading and cycles was pretty much you had a bunch of shaders and you had to mix them together And you had to know what you're doing to get a decent result A lot of people ended up doing PBR notes that were floating around on various websites and often they were just crazy complex So Yeah, it was basically time to do something better there. A lot of people might remember this setup I had to download 2.79 for the screenshot, but yeah Just a bit of nostalgia there and then in 2017 we got the principle PSDF This is based on research and work that Disney published which they developed internally as a Unified shading model to basically get away from every artist building their own massive shaders to getting a Simple model that everybody can just use The goals behind this were to have it be artist-friendly for it to be very intuitive and for all controls to They have an immediate Immediate use so you can see how this is taken from the blender documentation on the various options and what they do Also the point was that this should be able to handle a wide range of materials So ideally you would only need different shaders for very specialized stuff like hair, maybe And a nice thing about this shading model is that it was widely implemented at the time So there's a very good chance of you using a renderer that it has at least some form of this model In cycles this has several additional options over time So we've added a real subsurface scattering which is not in the original Disney work We've added the multi scattering GTX mode again One that later and the transmission roughness option is also not in the original in cycles This was added in 2.79 and it's been default ever since this was implemented by Pascal Schoen from Adidas So all credit goes there And that's very nice shader and everybody's using it nowadays and people like it. So what's wrong with it? There's a few points that I have One big one is that it was originally designed for a particular stylized look I would say of course it is Physically based and so on but well Disney does not do architectural visitation really they don't care about Quantitatively correct results. They just want things to look nice But cycle stuff does have a very wide range of users and some of them do actually care about things being Correct rather than you know nice looking and physically based So Yeah, this is one problem. Another problem is this multi scattering that I mentioned I Implemented this back then because I thought it could be very useful and it could be if it was production ready. Unfortunately, it's not So this is supposed to fix the problem that the shader gets darker when you increase the roughness It does that but it also slows the render down it adds additional noise and fireflies and It's very complex code and there are quite a few bugs with it currently and Another problem simply is that the Disney BSDF back then was not designed to accommodate multi scattering So it's kind of like packed in there Another problem is energy handling So it does not conserve energy with certain combinations You can end up with more energy being reflected than its incoming which is not great for path tracers And it also does not preserve energy. So you can You get the starkening effect sometimes Another problem is that with all of these additional effects being added to it The controls are not really as elegant as they used to be so there's three are your controls for example There's the real IOR which is used for the Refraction there's the subsurface IOR which is not used for much to be honest It's just used to for the albedo matching and then there's the specular slider Which does not look like an IOR but internally is converted to IOR for the specular highlights One funny thing which is one of the reasons why I even started all of this was there was a bug report that if You set the specular slider above 12.5 You get black results and the specular slider is supposed to be a percentage You're not supposed to set it to 12.5 and when I asked what are you doing the answer was well I have this particular IOR value that I want So I looked in the code and found the formula to convert and I inverted it I found that I need to set the specular slider to 13 to get the IOR that I wanted That's not an ideal workflow that we should be better than that Some other options are just not there that users might want on the metal side particular There are some things that we could add and on our adding and some controls are just kind of pointless like the subsurface color I often see people of hooking up complex shaders to this input and everything. It doesn't really do much all it does is When you drag up the subsurface slider It mixes the subsurface color with the base color and uses that instead But because people usually set the subsurface slider to like 0.01 It barely has any influence, but a lot of people just don't know that and put way too much effort into picking a subsurface color So that's not great And also simply, you know time moves on this original Paper came out in 2012. There was an improvement in 2015 cycles got in in 2017, but of course Research is still happening and in particular in the last five years. There's been a lot of work going on this field a lot of people presenting new approaches improvements and Well, we should have those Because they are put in particular address many of the problems that I've just mentioned Also just some quick points It doesn't play well with subsurface because the original model that was never supposed to have real subsurface. So it's not ideal This multi-skepting problem that are better approaches comes back to this research point the sheen option is not even a real sheen It's it was designed back then from what I understand to Some of sort of work around the starkening problem But just making things brighter and it's not really a sheen in the sense that people want to use it for for a cloth for example And also one import one important point that I think is We really need to pay attention to this big this progress in the industry. So for for a long time the way I remember it with Exchanging data between DD software was geometry is easier ricks are kind of complex shading Just don't even bother because every software does its own thing But nowadays the shading models are starting to converge everybody does very similar things Everybody has their own in-house option that some artists wanted, but overall pretty much every the commercial software and also game engines and so on and so on has Very similar settings now. So we should we should support those, you know material x gltf usd Commercial software game engines also all of them do similar things nowadays. So we should definitely be compatible with that principle the existing principle PSDF is kind of close, but yeah, many of the new elements are just missing so That's just the list of Motivations and now before we go to the solutions a bit of background To understand some of the problems and what the solutions are even doing So shading before you go to shading you have to understand what even is light in real life Light is very complex. You can spend your entire life studying physics and still have no clue What's actually going on because depending on which field you're in you just need very many different Many different models, but in rendering it's we make it quite simple for ourselves We just say okay, we do geometric options light as a ray this ray bounces around and we are happier So this means we ignore wave physics we ignore polarization We assume that light just has infinite speed and so on and so on. Mostly this is fine, but you start to get any problems when you look closer because Many Fundamental properties of objects can only be explained by these advanced effects. So we can just completely ignore them Instead what we do is we look at these effects on paper We use them to derive a mathematical model for shading and then we just use that model with the geometric optics one classic example is this blackbody radiation node that you would use for for hot objects in cycles or for light sources To actually derive what's going on there. You need quantum physics Actually, that's the historical reason why people started doing quantum physics But of course we don't do quantum physics in cycles instead. We just take the result write it in the render engine and we're good to go So this is sort of the approach that people take there I've said principle BSDF probably like ten times by now a classic question What it even is a BSDF it kind of just shows up in the blender interface and people go with it so there's a lot of these Be something Df revolutions that fly around in the shading literature What does this even mean a BSDF is a B directional scattering distribution function and what it does is it tells you how much light is reflected or More generally scattered from one direction to another direction. So you have this classic diagram here You have some surface you have a position where you're looking at you have an incoming and outgoing light To make things not confusing at all in cycles the omega o is labeled as I in the code There are reasons for it, but it's one of these things And yeah, this model just tells you how much light is being reflected The different ones that were in the title are just variations on this So BRDF and BTDF for the reflected and transmitted parts respectively BSS RDF is what you get when you start to do subsurface scattering We have an entry and an exit position and not just local scattering But this does not really matter for this talk just to go over to go over some of the terms there What we actually need from a BSDF For a render we need two things we need to be able to evaluate the BSDF for given directions Like we know we have an incoming ray. We know where the light source how much is reflected and For an incoming ray. We need to pick an outgoing position In this talk, I'm going to completely ignore the second point because that's getting too much into the implementation So we just assume that if we can calculate everything we are happy So What's going on what should our shading model do I mentioned physical processes? What are these on a microscopic level? There are roughly two categories. You can look at you have on the one hand light Inner material where what happens to it? It gets absorbed where the energy turns into a different form of it the light turns into a different form of energy And you have scattering processes where the light changes its direction in the medium and then there's a separate Type which is the interaction at material boundaries where you have a difference in the speed of light in the material So the speed of light in air is pretty much the same as in vacuum, but in gloss for example It is slower so what happens when the light hits such a boundary is you get a reflection and you get a refraction So the part that goes into the material changes direction and the reflected part just comes back and there's a certain Certain balance between those two I'm on that in a few sides This difference in speeds of light is the index of refraction All of this is nice, but of course this does not This does not match the full range of materials that you see in the real world So what's going on there? What's going on there is that we of course do not see on a microscopic or atomic perspective And we only see the overall effect of what's going on in this on the scale so Pretty much what happens on the surface Depends on material properties there the two rough categories of conductors and dielectrics Conductors on materials that conduct electricity dielectrics don't For conductors what you end up with with is that they reflect a lot of energy here the reflection is colored because the amount depends on the wavelength that you're looking at and While metals technically do also reflect the light into them They have very strong absorption inside of them So as soon as you get past a few microns there's just pretty much nothing left So for practical purposes you can say that metals are opaque For dielectrics on the other hand you have a quite low reflectivity You don't get any colors on them unless special cases for those who were at the Redescent's talk yesterday and You get the reflected light that just continues inside the material because typically by themselves these materials do not absorb very much And the interaction inside the volume you can sort of divide into three categories That's the case where the scattering is extremely dense. So the light immediately scatters around all over the place This ends up looking diffused to our eyes Then you have the case where the scattering distance is a bit higher That's usually what we call subsurface scattering and computer graphics Then you get the case where the scattering distance is far enough that you can't get away with cheating anymore And that's where you need the actual volumetrics done So in theory you could just render everything with pure volumetrics, but it would be just extremely slow of course Which is again comes back to this point of We take the effects and we sort of boil them down into a mathematical model because for many cases diffused shading is perfectly fine You don't need the volumetrics I've said a lot now about light gets reflected and some light gets reflected and there's a certain Ratio between them. What is this ratio? The answer is the Fresnel equations Fresnel is another one of these terms that everybody knows But what exactly is behind it? Well, it tells you how much light is reflected and Whatever isn't reflected gets reflected and then maybe absorbed In theory in the general case the Fresnel equations can get very complex So I just included this here for a quick taste this isn't even the full model So in general you have complex valued indices of refraction You have complex valued output from this. This is not even shown here. This is just the real case It depends on the polarization of the light and it depends on the wavelength of the light Luckily in rendering we don't usually don't need the full form so we can we can do a lot of shortcuts for one thing we assume that light is not polarized and we Generally ignore the phase shift that happens So we just care about the amount of light that's reflected. We don't care about the phase shift of the wave because humans can see it So then two two relevant cases remain again dielectric and conductive for the dielectric case we have indices of refraction that are just a single number and It does not depend on the wavelength So most of the complexity goes away and we're only left with a fairly simple formula that depends on the index of refraction And the incoming angle of the light. This is what the Fresnel node and cycle stars And this is what you use for like glass or plastics or water or any ice any of these typical transparent materials Then there's also the second case, which is a conductive Fresnel This is what happens for metals there you have the complex valued index of refraction and it also changes with wavelengths So you usually see this written as N and K for example It's a bit more complex, but this is what you compute for metals an example for what these functions look like is this So here you see the reflectivity versus the incoming angle White line is gloss and the colored lines are the RGB values for a nickel for example. So, yeah, what you see here is If the light comes in fairly fairly from like vertically You have very low refraction and as you get to the more grazing angles it always goes up to a hundred percent For gloss the base reflection is fairly low. It's usually like four percent or something like that Whereas for metals, it's much higher and for metals. It's also different for the different colors So here for example, you see that nickel has kind of a yellowish hue because the red is stronger than blue But even with these approximations I just mentioned the equations can still be quite expensive to compute nowadays That's kind of fine, but people also wanted to do it 20 years ago. So back then it was very much not fine So there's this famous approximation the Schlich Fresnel Where what you basically do is you compute this reflectivity at zero degrees You call it F zero therefore Fresnel zero degrees and then you just look at the angle and compute this and mix it with white And that's it. That's the entire fresnel This is surprisingly accurate The only parameters this F zero you can compute this from the IOR again fairly straightforward or for artistic control you can just let the user directly pick F zero and While I say approximation there are arguments to be made that at least for metals and at least if you're not doing spectral rendering This might actually be better than just doing the full Fresnel on the RGB terms For more info just very good presentation here So here's a comparison. This is what you get if you use this approximation again the glass and the nickel case and here's the Here's the real formulas. So you see for the white line It's quite close for the metals There's a noticeable difference because metals have this tendency to dip and reflectivity a bit before they go to 100% and Yeah, this this F zero model does not reproduce this What are the advantages of it? It's very fast to compute because you already have this cosine thing So it's really just a bunch of multiplications and you're done graphs cause like that. It's quite accurate. It's decent for metals, but we can do better and One very big thing that has made this very popular is it's linear with respect to this F zero parameter So if you have two materials instead of computing both materials and then averaging them You can just average the F zero and then compute it once and you get the same result Which is very nice for mixing and real-time applications and so on So especially in the gaming and real-time world. This is the Fresnel model people that don't even care about the real equations Everybody uses this There's two well-known workflows expect loss and metallic roughness and the first one you pre-compute this entire F zero term and just Store it in texture in the other one you have your metallic parameter and so on and so on and then you compute the F zero in the game engine But both of them work out to the same model in the end So so much reflection that's kind of nice, but so far I've always talked about perfect reflection So mirror style like comes in like goes out same angle. Of course, that's not always what happens What if you also have rough glossy objects in real life what's happening there is again We have microscopic versus macroscopic That's kind of a recurring talk a recurring demon this section on the microscopic level things do in fact reflect perfectly but The geometry is very uneven. So on rough objects You just have lots of fine surface detail if you look at it. It looks like a flat surface to you But then from the macroscopic perspective the reflection gets rough. So how can we model this? Oh? and computer graphics usually Divide this into three layers in your hierarchy So you have the very rough detail which you handle through geometry Then you have a bit finer detail for that you have normal maps Then you have the super fine detail where you really don't care about the specifics You just put that into the material model to get your nice glossy reflections the way this works is through so-called micro facet models You assume that each facet is perfectly smooth and a perfect reflector And you assume that they are randomly distributed There's many different Distributions for this again terms you see floating around tgx backman gtr1 blinfong and so on these are all just different statistical distributions for these orientations of these rough surfaces and The higher you drag the roughness slider the wider distributed. They are of course How can we compute this so this is kind of what it looks like we assume we have this rough surface we know we have Incoming an outgoing direction So we know what direction the surface needs to point in order to get a nice reflection But the angle is equal so if we know this direction We can look up how likely is it based on our distribution and then we need to compute the Fresnel term What's important here is to get accurate and Real-life results you need to compute this Fresnel term on the micro facet So based on that reflection angle not the angle to the bigger surface. That's one of the things the cycles is was unable to do before the principle PSDF and That's something you're still unable to do if you just use the glossy node because yeah, you need to implement this sort of thing directly in the shader because in Them in your node tree, you don't know the incoming direction yet. So you have no chance of computing this Yes, and one Problem there do we start to run into and that messes things up is that these if the surface gets rough the facets can kind of Cast the shadow on each other and block each other and that's where the starkening comes from more on that later That's nice and all We now have one shiny surface But sometimes we want to combine them for example, you have this classy a classic glossy on diffuse that we saw earlier How do you do this? That's a classic example of layered materials So you could again do this explicitly in your render by just having like three objects That's on top of each other with some sort of displacement between them But the noise you would get is crazy. So we just again bake this into the material model And what we assume there is the layers are stacked on top of each other The light comes from the top and then something reflects off the top something goes into the layer Then maybe gets reflected lower or even gets transmitted into the material and at some point either at the top or the bottom The light comes out again, and we assume the layers are thin enough that this difference here between the incoming and the exit point Does not matter. It's just We assume it's all one point So that's how layered materials are typically implemented and now Conserving preserving energy also one thing that I brought up before wise is important energy conservation is absolutely essential for physically based renders if the surface reflects more energy than it gets then we start to have problems and in practice This can lead to noise and renders not converging and weirdly bright weirdly bright regions and objects and of course in theory, it's also completely unphysical this can never happen in the real world One reason why this can happen is that people just add layers on top of each other So if you just take a diffuse then add a reflection on top of it Well, the diffuses already designed to reflect or lights if you add a reflection, you now reflect light twice, which is not ideal the way you want to account for this is to say Only the light that does not get reflected by the top layer should hit the bottom layer But it's sometimes not that easy to compute how much light you actually get through Especially when you do this Fresnel on the micro facet and so on and so on so in practice what people Nowadays do is they just pre-compute all of that. So this is known as albedo scaling You just have a lookup table where you look up. I know my roughness I look my I know my incoming angle and know my indexes refraction how much light gets through you compute this once And they just use it and honestly, it's good enough Then conserving energy is nice and all what about pre-serving energy? It's kind of the opposite We don't want to create energy out of nowhere, but we also don't want to lose it to somewhere Yeah, materials should not lose energy unless the user really wants it by setting them darker common problem with this is micro facets where the facets can shade each other But the mathematical model that is typically used only accounts for a single reflection in real life You would have multiple bounces on these facets, but with the classic model at least it just doesn't happen So the light is simply lost This then ends up looking like this. So there are five spheres with increasing roughness and They should ideally have the same color as the background Because well, they should reflect or light, but they don't This is what it would look like with the multi scattering ggx So this is the accurate version and you see that the the spheres all blend into the background Ideally we would want that and especially for rough materials the difference is just night and day basically This is the same color the same everything just accurate or not How do how can we how can we solve this problem? Well darkening is one problem another problem actually is not problem and effected Missing is that materials get more saturation as they get rougher because if it bounces multiple times You also have the Fresnel effect multiple times So the color of the surface kind of stacks up and again, this is not this is lost if we don't account for this So there is a numerical model to handle this. This is the multi ggx that's in blender right now downside as I said It's not that great for production people are researching it There are being improved the improvements are being made, but it's not at the point yet where you really want to use it So why not just fake it? There are two ways to do this that came up since 2017 one of them is You kind of again pre-compute what the additional bounces would be and add them to the model And the second one is even simpler. We again do this a video scaling We just pre-compute how bright is the object and then we divide by that or divide by one minus that to Force it to become bright enough to basically reflect everything in the end again the downside is that the exact Distribution of the reflection is not accurate, but the overall brightness is and honestly, that's that's usually good enough You also account for the saturation. There are ways to do that And then you can end up with something looks pretty close So here's an example again the picture from before this is what this single scattering look like This is what the reference multi scattering looks like and this is the approximation So you see it on the right-hand side the shadow is not quite the same This is because of this directional this difference, but the brightness is the same and honestly That's all you really care about and practically you're not gonna see this this shader difference on the right And then the final point in the theory before we get to the actual principle V2 So-called thin sheets. This is another common type of material. For example, you might see this on leaves or on paper where the object is so thinner that In practice, you don't really want to model it like if you were really physically accurate and wanted to do Believe for example, you would need to take a box and scale it all the way down So it's like one millimeter thick but in practice people just use planes But the problem of this of course is that if you then do a reflection on this for example The refracted rays just gonna continue on and on because it never hits the back surface because well you didn't model it so Can we do something about that? Yes, we can once again We can turn this into a mathematical model where we say You know what we handle both these bounces in a single hit So on the top there's the classic example what you would in theory need to do and on the bottom There's just a thin sheet approximation where you say whatever it's thin enough that we compute the Entry and the exit refraction at the same step and in the end the ray just kind of goes through and changes color and gets reflected There are some subtleties to this where if you have roughness then Since the roughness kind of applies twice the outgoing roughness It has to be wider than the reflected roughness, but again There are papers on how to account for this and in practice just a simple factor and then it looks very similar And it's good enough for practical applications. I would say so so much for theory now new principle v2. What's going on? Fundamentally again, this is a layered model as the old one was On the high level the changes compared to the old one are that it now conserves and preserves energy by default You can easily test this by just taking the model setting the background color to white Just taking a sphere and no matter what you do on this on the new model It should not be brighter than the background on the old model It is very easy to run into that case and it should also be as close to a background as possible It should never be just dark gray or something So this means that it's much more intuitive for artists to pick colors for example And you can change parameters change roughness without being worried that you need to account for this by increasing your color to kind of get the same look again One thing that I think is a notable change is it will be Physically accurate out of the box so a bit more on the physical side than the old principle PSF Which was really 100% Artists driven only but of course artistic control is still important So there will be additional artistic controls on on it So by default the model is designed to be physically accurate But if you say I don't care about physics I want this reflection to be pink then you can just go into the You can just go into the artist controls and set your reflection to pink knowing that now it's not physically accurate But if you don't care, that's that's perfectly legit Matt The sheen component as I said kind of pointless so it will be replaced by a new and actually useful one Metallic and clear coat components are being improved. There is the skin sheet mode that I mentioned which will be added to it and There's some quality of life improvements more on that right at the end So what's the layer stack looking like we start with a very with the basic of basis of the material we have a diffuse Layer which can also be subsurface depending on what you use as your subsurface radius if it's zero Then it's just diffuse otherwise you get subsurface on top of that We have this dielectric specular reflection that gets controlled, you know by the roughness slider Then also there's metal in addition to it I've put this next to it in the diagram to basically show you can mix between those So you have metal or you have diffuse plus specular depending on your metallic slider Then there's also the transmission component. Of course, you have the transmission slider. So this just models pure dielectric which refracts into the material classic example being gloss of course on top of all of these you have your sheen layer Which is supposed to model for example Fibers or hairs on top of the material the classic example where people use this is a peach fuss It's the one that comes up in all the papers or just for for cloth This is a very important effect on top of that. There's the classic clear coat layer. We can get an additional Dielectric reflection on top of metals as well as so Yeah, you can get this on top of whatever you want and then there's also just for utility There's the transparency options still and there's still emission that are just added on to everything else in one box So that's the overall model So let's look at them in more detail. There's the base layer Which has the three types of material. There's the diffuse type diffuse covered by dielectric Microfacets at specular layer depending on what you're set your subsurface scale to it automatically switches and For one implementation detail is that it uses the same macro facets as the metallic liar Just for performance reasons So if you have a bit of metallic and a bit of diffuse you don't need to do the entire macrophysic computation twice But it just uses the same layer and mixes different L terms This way it's much more performant one interesting result of this is that the anisotropy also applies to the diffuse specular But for some materials you might actually want that like for brushed plastic I don't know if it's a real world thing, but if it is you can now simulate it Then there's the transmission type. This is just pure dielectric and this does not share the micro facets with the other two on the one hand, this is to not have anisotropy there because I'm not sure how realistic it would be and also because this way we can compute the Decision to reflect or refract based again on the micro facet for now. This actually makes a considerable effect on the look I found that when I implemented this multi scattering approximation for the glass look this Microfacet based reflection on transmission is more important than the overall brightness thing to just making it look more realistic So that's why it's a separate thing in the code and then there's the metallic layer. This is where it gets interesting So I showed you that f0 Fresnel model does is not really super accurate for metals and we can do better there So how can we do better? What are our options? We could just continue using the f0 model. That's what the current principle BSDF does But well, it's not really you get ignore this edge darkening effect, which is not nice so we could use the real conductive Fresnel equations that way it would be super accurate but the problem is that they are quite expensive to compute and complex I was just Unintuitive artists you can look it up in online tables, but if you say hey, I want this metal to look a bit different Good luck figuring out which values are gonna make it look different in the way that you want. So that's not really a Fantastic option then there's this artist friendly conductive Fresnel paper which has a method where the user selects a edge color and a Base color and it automatically computes this complex IOR for you It's fairly widespread But the problem is that you still have to compute the real conductive Fresnel and on top of that you also have to compute the conversion that's even more expensive and This thing I mentioned this other talk I mentioned before with the f0 is perhaps as accurate as the real one also has very good theoretical reasons why On a theoretical basis this artist friendly formulation is not ideal, especially when you look towards spectral rendering and topics like that Then one interesting option is the so-called generalized f0 model where the idea is that instead of always going to white at 90 degrees You let the user select the color at 90 degrees and you also instead of always doing the power of 5 You let the user select that as well to control the falloff a bit It's nice, but an even nicer model that I found or that was shown to me as the f82 tint model So what does this mean? This means that It's based on the f0 model, but you have an additional parameter that controls the Appearance around 82 degrees which is around where this dip is supposed to happen So the idea is originally in the original source for this model Just had you input the color at this area at this angle But this modified version which was published by adobe in their standard surface material where you Multiply the reflectivity by a certain factor instead, which is nice because then if you just set it to white It doesn't do anything and you get the old f0 model Which is compatible with what game engines and so on and so on doing are doing so this is why I really like this model And this is quite cheap to compute If you want to match remittals, I have a script for that. It's linked in on developer.blender.org What you do is you compute your reference spectrum by using the real conductive Fresnel equation I just do this in Python then you convert it to Whatever linear color space you want to use and then you do an americ fit to choose parameters I don't expect users to do this So I did it for a few well-known metals and just put all of their values in on developer blender org We can put that in the documentation at some point One thing that is often brought up in documentation and papers Even commercial software sometimes has this in their manual where they say just pick three wavelengths like 450 ish for blue 550 ish for green You can do that, but it's much more accurate if you do it with this with this proper computation So what does this look like again? Here's our basic f0 modeler So here's what our nickel looks like. We don't have this edge darkening Here's the reference again what it should look like and here's what the new model gives you So you see that we have this darkening effect and it's much my cred Of course graphs are nice, but pictures are nicer. I need to warn you I am not an artist by any means so do not expect any fancy pictures, but yeah This is basically a chromium and nickel. This is the old modeler with just a zero and this is the new one You see the difference isn't big But around the edge there is a noticeable difference and for some metals it is more pronounced for some it is less Iron for example is another big case For copper just doesn't matter for example But yeah, if you want super accurate production of colors, this this is kind of nice So much for metals now back to this dielectric case on on The diffuse base you would might think it's just dielectric finale. I said this is the easy case It's a nice equation. How hard can it be? Turns out very hard because the challenge there is that People like to do their own thing for example The principally one has the specular slider for this that converts to IOR and then computes it Game engines often do the spec loss thing. We just have your f0 texture and they also bake metallic into that So we kind of want to be compatible with all of that There's a solution for this which that this comes from the gltf Specification where you add some additional inputs. So you have your IOR you compute your f0 based on that Then you multiply that with one tint factor Then you apply this this slick vanilla model on top of it and then you apply everything with a second tint factor So this this seems complex, but ideally this will be this will be Quite intuitive. I hope and ideally this these are all the non-physical controls So as a user, you don't really have to touch this. This is more interesting for automatic importers for example One neat thing about this is that you said if it's the IOR to zero then the default model just full reflection everywhere So then you can use this tint factor to just directly input any f0 You want which is how this is compatible with this whole spec loss workflow One thing that's not yet clear Is which Fresnel term do we then use do we use the real one or do we just purely use the approximation? I'm tending towards the real one because for some corner cases. It is much microd But we'll have to see of course the problem then is the real one doesn't have this Tint input so what you then do is you compute the real value and you rescale it to what to the range of what the other One would have that's also what principally wonder v1 does right now So that's that next part sheen layer as I said the old sheen It's just ad hoc fix to kind of try to work around this energy loss problem since this problem is kind of addressed now We might as well have a proper sheen instead There is one again. Here's the reference. This is a model from Sony image works It's based on the microfaceted approach again, but instead of saying okay We have this rough surface their ideas that you look at fibers So it's basically a flip by 90 degrees and the reflection is always of fibers that stand on the surface And again, you have this roughness input to control the distribution of them There's no for now term in this model instead. There's just a tint with tint input where I can set your color because Well, this is already such an approximation that trying to be physically accurate about it is Not really worthwhile Unfortunately adobe appears to use a different sheen model. There's this based on micro flake theory From what I can see currently the one the first one is more widely supported like gltf material x and so on and so on all use it So I'm going with that one for now if there's really strong feedback on hey The other one is so much better. Please can we have that of course? There's also an option for comparison. What does it look like again? Image warning at this is not very artistically Fancy, but I hope it gets a point across. So this is just basically fuse material with no sheen applied This is the old sheen you can see it just kind of makes it a bit brighter But not much else going on and then with the new sheen model it looks like this So you get this velvet style effect kind of like the old velvet bstf except that you don't have this heart This hard corner that the old one used to have Also one important point is this is at 100% in the old model and this is just 15% in the new one So you can really crank this effect if you want to it would look stupid here because the base is so dim But if you have Lighter material then you might actually want to turn this up higher Here's a nicer picture from the original paper where I can see this roughness effect and Basically at low roughness it only really affects the edges But the further up the roughness goes the more it goes towards the center of the material Then there's a clear coat layer This was already in place in principle V1. It's fine as is I haven't seen any good reason to change it So there's no like major breakthrough in research or anything in that area Some people that you choose some render engines that you choose the IOR some choose a different microfiber distribution, but I Don't really see this super important. We could add it, but I don't think it's particularly particularly important One thing I did add though is clear coat tint Why is this relevant a? Common thing that comes up in this principle in this physically based discussion is colored reflections So people say I want I Want my colored reflections then the theory people say no reflections are always white You're not supposed to have colored reflection then people say I want them anyways So why do they want them one reason why you might actually have colored reflections is if you have a coating on your Material that is tinted so then the reflection on the underlying surface actually is white But because of absorption the layer above it you end up seeing a color reflection So why not implement that and the way I'm doing this is just you look at the incoming ray You compute the reflection then you look at the distance that the ray travels in your clear coat layer and You just do volumetric absorption based on that so the color you input is for just vertical Just if you look at it vertically it has that color and the flatter you look at it The more saturated color becomes because the light travels a longer distance One thing that caught me at the start you need to look you need to compute the reflection of the ray and then compute the length If you don't do that you get crazy saturated edges because the ray just goes forever in the material So yeah One thing to note with the clear coat layer is this refraction effect does not actually affect the lower materials So we compute this refraction to get the tint, but the actual incoming direction. That's used for the lower layer still the original It would be way too hard to implement this interaction and honestly it does not really make a difference. I tried it It's it's a small detail. There are papers that do all of this accurately, but it's 30 minute pre-processing time before you start rendering just to pre-compute all terms Not yet practical once again Here's an example of what it looks like so here's just This is without this effect. This is just I took a metal and manually made it a bit redder So this red shiny metal with a clear clear coat on top and this is the same case with Just pure aluminum with a red colored tint on top so you see Where you look at it head on it's very much the same but to watch the edges it gets a bit darker and has this nicer fall off Again subtle detail, but for some cases this makes an interesting difference Also, this means that you can just use real physical values for an underlying metal and don't need to manually hack in your red metal color Yeah, what else is going on? Transparency and emission no change there Volume controls are interesting so in the old model the base color affected everything even Transmission so if you had glass and you set the base color to blue you would get the light would be color blue on refraction That does not make any sense in terms of physics a refraction and dielectric objects is not supposed to change the color instead if you have colored glass what's generally going on is that there's There's coloring inside the actual model so inside the actual volume so it should be volumetric and people just Put a color on the surface and call it good enough instead what Many models are not doing and now what also principle v2 is doing you have this absorption depth control Where the refraction itself does not have any color, but you automatically add? Absorptive volume Insided and this absorption depth option basically says how deep should you have this color input and the absorption depth says At which depth should the object have this color and then if it ends up being a dinner section Then it has less color and if it ends up thicker it has more color And then of course transmission is not colored if you apply this by default Some things about this is still unclear You know that cycles are shading in blender in general has this surface and the volume output It's really annoying if you have to connect both surface and volume output of the principle BSTF So they should somehow be done automatically Probably just a case of if you don't have anything plugged into the volume it automatically Acts as if it was connected for you another question is do we also want volumetric scattering option right in the principle BSTF Could be done. Not sure We'll see Again for a comparison what this looks like this just a simple gloss So this is the old model where you just apply a blue color with principle v1 And this is what it looks like with the new one So you see the shape of the gloss better You see that there's actual thicker and thinner sections the bottom looks a bit different So yeah, just again, none of this is crowd breaking. Oh my god It looks ten times better, but it's just the small things that let you model things more accurately And then finally we have the dinge mode This is a You supposed to be a simple checkbox You just say hey, this is the dinge and then everything happens automatically instead of transmission You just get the exit at the other end There's also disabled subsurface scattering because if the object is so small, you're not you can't really have any scattering in it a few things are still unclear like do we need Translucent effects or is it enough to say I crank up the roof the roughness and the transmission kind of gives you the Translucency effect by default needs to be checked One thing I also want to add is transparent shadow optional This is relevant for architecture for example when you want windows to have nice reflections But to not add any noise because because of caustics and what people often do is they just disable the shadow visibility But that of course completely removes the shadow visibility So if you have a color glass for example, you just don't get any color in the shadow So the idea is to have a checkbox that automatically for shadow rays replaces the principal BSDF with a transparent one with the correct color So you would get the correctly colored shadows with assumption everything without the noise in caustics Could maybe even be automatic where if you have a low roughness it does this very fault So yeah, we're starting to come to the end. How does this all come together? I showed you the layers that got before we have the three base layer types We just mix them together based on the metallic and transmission factors Then click out the sheen are added on top with this albedo scaling to have the energy preservation and conservation Where we pre-compute how much does the sheen reflect and we just don't let that through into the lower layers Again all of the macrophysiol layers are scaled up to account for the single scattering energy loss One downside of this is there are lots of small Lookup tables that need to be pre-computed But you can do that once and it's just hundred values and you put those in the code and kind of forget about them because the model never changes So the numbers also don't change And yeah, that's the that's the plan components. So now what is the current state? What's going on there? This is what the model inputs currently look like you can see why does unchanged Green on new options red or removed options and yellow or modified options for time reasons I'm not going to go over every single one of them But you can see it's kind of similar but even more options are being added, which is a problem. So that's my last slide Possible improvements what could be done on top of that? Iridescence in the slides here. I still have it on possible improvements after the talk yesterday I've moved it up to yep. This is cool I've seen what you can do with it and we really want that I think the problem there is It's not super trivial to combine this with this artistic controls because we're not using the real fresnel So we don't have to face the friends, but for iridescence. This is actually important. So we might need to do some reversing where we compute the physical parameters from the artistic parameters and then use these and There are ways to do it, but we need to figure out what really works there Dispersion support is something that people requested a few times, especially now that maybe spectral rendering is getting closer This would be nice to have Nested dielectrics is a cool one where you have this classic example of you have multiple transparent or Refracting objects and intersect classic example liquid in a glass Where if you just do it the simple way it looks really bad And right now you need to manually select the interface between the two and set the IOR to be one divided by the other This is annoying. So we'll be nice with the render automatically to care of that and there's this approach called nested dielectrics That's quite popular for this and it should be possible to implement it I haven't tried it yet, but I don't yet see a reason why it should not be quite straightforward And also maybe all of these new components the new sheen and so on Principle is nice, but for people who want more control. We might as well add it as a regular node So you can do your own shader trees with it if you want to And yeah, some open questions remain user interface is big one We're adding even more controls the shader already looks ridiculous. So what can we do about this? One idea is to sort this into sections So I already had this on previous slide where it's kind of divided into categories And the idea would be to maybe have expandable and collapsible panels where If you don't need anisotropy because you don't do a metal you don't need the tangent input You don't need ten rotation and so on and so on so just have anisotropy panel that you can close by default And if you really care you can open it Also compatibility with the existing principle BSDF is a very big topic that I'm not certain about yet Ideally we would just replace it and have it look similar enough that people don't care in practice I'm not sure if that's possible. So worst case We might just have to keep the old one which is really annoying because there's a lot of code to it And we then kind of have to maintain both but we'll have to see And just a small thing Subsurface entry and exit is it's kind of annoying edge case where sometimes with the peptray subsurface scattering you get these white corners We might be able to do this better. We'll see Current status way behind schedule as I said I wanted to have this done in time for now Had way too much things going on and Did not really have a chance to work on it much the last few weeks months but now Now I'm actually Back to it and off the conference. I hope there will be very fast progress now There's a branch for this on the good blender.org. You can try it out Right now. It's very outdated of the talk and going to push Version with the latest master and then hopefully many additional changes The basic components are mostly there What is currently still missing is the thin sheet mode is not implemented yet the volume controls are not implemented yet A lot of things probably broke during development and need to be fixed. So OSL is just does not work right now Color passes so like diffuse color and so on and so on do not work Cost the controls are kind of broken important sampling. So you get a lot of noises and Evie right now just crashes because I changed the number of parameters. So the GLSL shader doesn't compile anymore. Oops But all of this can be addressed also performance needs to be checked and the open questions that I mentioned Also in the end just really checking with other software if we use the same inputs Do we get the same results because the entire point is to be compatible and if it looks different then that's kind of kind of against that goal and We want to make sure that compatible before it goes to master because then we can change it anymore Yeah, that's it for me Afterwards if you have any questions any suggestions any feedback come talk to me if it occurs to you tomorrow There's a thread on a dev talk where you can just submit feedback as well and that's it. Thanks for your attention