Popular Post Wolfwood Posted August 7, 2014 Popular Post Share Posted August 7, 2014 (edited) Hello. Since Houdini 12.5 and the addition of the cvex_bsdf() function the user base is no longer restricted to the confines of Phong and Blinn. While these models are tried and true over the past few years newer reflectance models have stepped into the spotlight (pun!), notably the ever so popular GGX. So for the lulz I implemented a variety of the newer ones and would like to share. Ultimately this is an incredibly huge topic and would take a significant amount of writing to explain all the fun bits so instead I'm going to link spam because I got TF2 to play. Background & Learning Physically Based Rendering for Artists (youtubez) Physically Based Specular for Artists Basic Theory of Physically-Based Rendering Cook-Torrance Model in Mantra Shader Microfacet BRDF (This is quite "mathy" but gives a nice overview of what is going on inside the Microfacet VOP) Disney BRDF (Disney's BRDF from Siggraph 2012, minimal parameters with a fair bit of flexibility. Required reading for the Disney VOP and also the GTR VOP) Siggraph 2010 Course Notes Siggraph 2012 Course Notes Siggraph 2013 Course Notes So with that all that background info out of the way on to the toys. In the attach OTL there are a few different VOPs, I've included a brief description here, but I actually (gasp) wrote documentation for each of the VOPs so I suggest you read them. Physically Based GGX (cvex) Microfacet BSDF with a GGX distribution, Schlick Fresnel, and Smith Masking. If you set the model to be "Distribution Only" it disables Fresnel and Masking and is purely just a distribution similar to how Phong, Blinn work. This model also supports anisotropic distributions. Physically Based GTR (cvex) A more generalized version of GGX. (GTR stands for Generalized Trowbridge & Reitz). In fact GGX == GTR when GTR's gamma parameter is 2. This is isotropic, Mathematica and I are still having a disagreement over possible anisotropic solutions. Physically Based Microfacet (cvex) This is everything and the kitchen sink. Its slower and not really meant for production cause it has all the options. But its good for exploring the various models and what they look like. Once a nice combination is found you'd would make a more dedicated and optimized version similar to the GGX/GTR ones above. You might get some fireflies with this for certain combinations as some of the formulas will converge on infinity faster than others. Generally the easiest way to fix it is to increase your Roughness G. The Roughness G parameter allows you to control the roughness Geometry Masking term independently of the distribution. Think of it as a multiplier for how much "micro-occlusion" you want. Disney (cvex) Direct port of the Disney BRDF. The parameters for this are suppose to be generally kept between 0 and 1 however I find the sheen to be way under powered when at a value of 1, so you might need to crank it to 11 to see it. Please read the help card for this VOP, there is some special sauce overriding functionality I added. Disney Mixer VOP for mixing collections of Disney BRDR parameters. (Or BSDFs) How My Versioning Works major.minor.hotfix.build Majors: are full rewrites and I'd be amazed if the look stays the same. Minors: are important changes that might affect the look but I'll try to avoid it as much as possible. Basically I'll only change the look if I'm fixing a flaw. Hotfix optional: is for cases where some bug that needed fixing but doesn't change the look. Build: Builds are the number of commits since the previous release object. These will go up during development and once a release is frozen the build will stop. These don't affect namespacing and only show up in the otversion. Reporting Issues If you have a issue/bug/question please ask, I (we) are using variants of these in production so there will be continued support. When asking tho I ask/plead that you post what version of the shaders you are using. That way I know exactly where to took. You can get this info by middle mousing on one of the VOP nodes or running 'opinfo' on it. For example- / -> opinfo /shop/vopsurface1/pbrdisney1pbrdisney1: Full Name: /shop/vopsurface1/pbrdisney1 Operator type: pbrdisney Version: 1.1.55 Branch: release-1.1 Date: 2014-08-06 Commit: 6fc9e7f All that version, branch, and commit info is music to my ears. (If nothing else, please provide the commit.) Obligatory Renders of Smooth Objects Both these wedges are of the GTR model. One with varying roughness, the other with varying gamma. (Gamma on the GTR model controls how fast the specular tail falls off.) OTLs There are two OTLs, both with the same shaders but one OTL has namespaces and versions on the type names the other one doesn't. If you are going to use these in production or what-not I recommend the namespaced version that way if there is an update later one they can live side by side. If you don't care and are playing just go for the non-namespaced one. All of this stuff currently sits in a private git repo on bitbucket, once everyone bangs on it a bit and I get everything rock solid I'll switch it to a public repo so others can contribute. v-1.2 (devel)bsdf-v1.2.otlbsdf_namespaced-v1.2.otl v-1.1.1 (stable)bsdf-v1.1.1.otlbsdf_namespaced-v1.1.1.otl v-1.1 (stable)bsdf.otlnamespaced_bsdf.otl Release Notes: 1.2: Removed roughness masking remapping on the Disney BSDF. (Edges will reflect more light now.) 1.1.1: Workaround for Houdini LLVM bug #63368 Added an Ashikhmin Diffuse VOP which handles microfacet masking 1.1: Initial Public Offering Known Issues: Calculation of albedo needs some thought. Currently the albedo returned is the normalization factor for the distribution function. While this matches how phong() and blinn() are setup, it should instead return the full reflectivity over the hemisphere taking into account frensnel (and masking?). Edited August 22, 2014 by Wolfwood 27 Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted August 7, 2014 Author Share Posted August 7, 2014 (edited) Other Tidbits- The GGX/GTR model has a roughness parameter that ranges from 0 to 1 instead of phong/blinn's shiny parameter that goes from 0 to inf. In Houdini the shiny parameter has been reparameterized to be a angle between 0 and 90 degrees. Blinn and Phong both have a well defined specular lobe that where as the GGX/GTR model's lobe has a really long tail that falls off over the full hemisphere. (Which is why people like it.) Because of this there isn't really a direct one to one mapping of the parameters however if you are only comparing the brightest part of the lobe you can get a fairly close mapping with the following $roughness = sqrt(2.0/sqrt(6-log(4)/log(cos(radians($angle))))); Edited August 7, 2014 by Wolfwood Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted August 7, 2014 Share Posted August 7, 2014 Thank you for this. This is awesome. I will go and check this out asap. Could you explain a little bit more on how you use Mathematica to evaluate your BSDFs? Maybe you could even share a notebook? cheers, Dennis Quote Link to comment Share on other sites More sharing options...
Skybar Posted August 7, 2014 Share Posted August 7, 2014 Amazing work Jim! I have no idea about all of this really, but I will definitely give it a spin when I have some time to spare. Quote Link to comment Share on other sites More sharing options...
Mandrake0 Posted August 7, 2014 Share Posted August 7, 2014 haven't test it but i sent you a big thanks for this work!!! Quote Link to comment Share on other sites More sharing options...
JoshJ Posted August 7, 2014 Share Posted August 7, 2014 So, I'm playing around with the new shading toys here, and they look fantastic. I'm wondering though, what's a good way to use these along with refraction? Would I add a physically based specular with refract label, and use the fresnel vop to blend between them? or add them together? or is there another more "intelligent/correct" way to implement refraction here? Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted August 7, 2014 Author Share Posted August 7, 2014 (edited) So, I'm playing around with the new shading toys here, and they look fantastic. I'm wondering though, what's a good way to use these along with refraction? Would I add a physically based specular with refract label, and use the fresnel vop to blend between them? or add them together? or is there another more "intelligent/correct" way to implement refraction here? There isn't a "clean" way to do it currently. If using the distribution only (and not the microfacet model) you can flip the normals and do it similar to how the Mantra surface works (fresnel blend), but ultimately support should be built in. I already have logged an issue (#19) for this. So far only the BRDF has been implemented from Walter's 2007 paper, issue #19 is to implement the BTDF too (making the full BSDF). It shouldn't be too difficult, and is high up on my TODO list once I'm back from Siggraph. Edited August 7, 2014 by Wolfwood Quote Link to comment Share on other sites More sharing options...
Sierra62 Posted August 7, 2014 Share Posted August 7, 2014 Looks like I have a lot of reading to do this weekend. Thanks a lot for info. Quote Link to comment Share on other sites More sharing options...
JoshJ Posted August 7, 2014 Share Posted August 7, 2014 Thanks Jim, great work, looking forward to it! Quote Link to comment Share on other sites More sharing options...
gaurav Posted August 8, 2014 Share Posted August 8, 2014 Thanks ! Much appreciated Quote Link to comment Share on other sites More sharing options...
eetu Posted August 8, 2014 Share Posted August 8, 2014 Great work indeed, bringing mantra PBR shading to this decade .. once I'm back from Siggraph. If I were there this year, I'd buy you a gallon of beer Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted August 8, 2014 Share Posted August 8, 2014 After some initial testing all I can say is WOW. These are really looking great Very nice job. Quote Link to comment Share on other sites More sharing options...
Tom Posted August 8, 2014 Share Posted August 8, 2014 (edited) This topic is pure gold! Things like this can only happen in houdini land. Thank you Jim for this brilliant work. Cheers! Tom Edited August 8, 2014 by Tom Quote Link to comment Share on other sites More sharing options...
Serg Posted August 8, 2014 Share Posted August 8, 2014 Amazing! and extremely generous! And there goes my weekend... testing and putting this into our ubershader asap... Many many thanks! S Quote Link to comment Share on other sites More sharing options...
eetu Posted August 8, 2014 Share Posted August 8, 2014 One small issue - Disney Mixer doesn't mix anisoAngle. Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted August 8, 2014 Author Share Posted August 8, 2014 (edited) One small issue - Disney Mixer doesn't mix anisoAngle.Ha. I was debating whether or not that parm should be mixable just the other day. Guess that answers that. I'll have it updated in a few hours. (And I'm looking forward to the "I told you so" from one of my coworkers )Fyi- currently none of the geometric parameters blend, like nN or the tangent directions. Edited August 8, 2014 by Wolfwood Quote Link to comment Share on other sites More sharing options...
eetu Posted August 8, 2014 Share Posted August 8, 2014 Furthermore, seems like the Disney BRDF in passthough-mode doesn't pass anisoAngle through, so in any mixing scenario the angle is 0 everywhere. Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted August 8, 2014 Author Share Posted August 8, 2014 (edited) Furthermore, seems like the Disney BRDF in passthough-mode doesn't pass anisoAngle through, so in any mixing scenario the angle is 0 everywhere. Correct, currently the disney_struct has no concept of any of those geometry terms and they can only be set on the final Vop. Was a design decision but an easily changeable one. (I had considered anisoAngle a geometric term, but I am easily swayed.) Edited August 8, 2014 by Wolfwood Quote Link to comment Share on other sites More sharing options...
eetu Posted August 8, 2014 Share Posted August 8, 2014 Ah, yes, I see. Hmm. If the layering scenario is e.g. brushed paint on brushed metal, then the aniso direction would need to be different for the layers? A bit contrived, this - dunno if there is an actual use case. If the layers are thought of as complete materials, then maybe the bump/normal should blend as well? Then again, if you want to have an option to use displacement, then you'd want to do the normal/displacement blending separately in the displacement shader anyway. Ah, I don't know, it's quite fine as it is in any case. Quote Link to comment Share on other sites More sharing options...
eetu Posted August 8, 2014 Share Posted August 8, 2014 Here's a quickie vopnet material for folks to play with the disney layering. Hope it's correct disney_basic_material_v002.hip 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.