rendertan Posted January 5, 2009 Share Posted January 5, 2009 Hi I've been reading some things, doing some exercises in my RSL&VEX adventures, and thought i could share some of the results. Basically, been reading about the Wolff diffuse BRDF, made the implementation in RSL, checked and rechecked everything, everything seems ok. I didn't had access to Wolff's original paper though, since it's available only by subscription to the users of Optical Society of America, but i found the Michael Oren, Shree K. Nayar, and Lawrence Wolff paper, "Improved Diffuse Reflection Models for Computer Vision", that covered the Wolff model. Just to make sure i got everything right, i spent some time in maxima&gnuplot, and everything matches This model was meant for smooth dielectric surfaces, the first graph shows the outgoing reflected radiance as the incident angle varies, of the Wolff model with an IOR of 1.5, with the Lambert response as a comparision, and the 2nd graph, the same, only with a group of curves for the Wolff model with varying IORs from 1.2 to 2.0 range. As for the indispensable teapots, first one uses the Lambertian diffuse term, the second one the Wolff diffuse term. I have a doubt regarding the Wolff model though, to be more precise, the scaling factor Q, which is similar to the surface albedo parameter in Lambert's law. The last paper mentioned, says that the value of Q is very nearly constant over most incidence and reflectance angles, and should be treated as a constant, unless you need very precise results, but i'm assuming this would be critical only for a Shape-from-Shading utilization right? To make matters worse, the expression for Q is quite complex, Chandrasekhar's H function, and my math level isn't quite at this level, yet at least...., so Q is an constant scaling parameter as mentioned in "Surface Radiance Correction for Shape-From-Shading". If anyone bothers taking a look at the papers, what are your opinions regarding this parameter? Is it worth it implementing the expression for this parameter at all, or this scenario only makes sense in Shape-from-Shading, or where correct measurements are expected? Anyway, the VEX implementation of the Oren-Nayar-Model follows, i didn't had time to plot it though. It's the full model with inter-reflections, not the qualitative model with 2 coefficients, i'm not sure if Houdini's Oren-Nayar implementation in its diffuse() shadeop is the qualitative model, or the full model with inter-reflections, i'll just have to do some test renders later to compare. Oren_Nayar_Wolff_diffuse.vfl As for the RSL versions, the Wolff model, and the Oren-Nayar-Wolff, i can post them later, as soon as i find out why i can't upload .sl attachments P.S.: and btw, Happy New Year everyone Quote Link to comment Share on other sites More sharing options...
Guest xionmark Posted January 5, 2009 Share Posted January 5, 2009 Thanks! Happy New Year! Quote Link to comment Share on other sites More sharing options...
Jason Posted January 6, 2009 Share Posted January 6, 2009 Hey rendertan, Thank you very much for this; it looks like some pretty involved work for some quite subtle results. Have you found that the results look more pleasing? Thanks, Jason Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted January 6, 2009 Share Posted January 6, 2009 Alright Luis! Thanks for sharing this. ... time to read some more papers Cheers! Quote Link to comment Share on other sites More sharing options...
Jason Posted January 6, 2009 Share Posted January 6, 2009 FYI, I've enabled .sl attachments on this board now. Quote Link to comment Share on other sites More sharing options...
rendertan Posted January 6, 2009 Author Share Posted January 6, 2009 (edited) Hi Mario, Jason, everyone Thanks for adding the .sl support Here follows a small test image of the Lambertian model, and the Wolff and Oren-Nayar-Wolff models with varying roughness and IOR values (i think my area light was a bit too intense though :ahem: ) I attached as well the VEX implementation of the Wolff model, and the RSL implementations of both models. About the look of it, well, the Wolff model up to IOR 1.6, seems to behave a bit like the Minnaert model with a high K value, having a limb darkening effect, i suppose this could be useful to model the appearance of plastic perhaps, with a specular highlight having its intensity driven by a Fresnel term as well. Wolff_diffuse.vfl Wolff_diffuse.sl OrenNayarWolff_diffuse.sl One question though, about the .vfl files: is it possible to have a shader in more than 1 language in a .vfl file, i mean, can i use for instance, a #pragma rendermask VMantra and do the VEX shader code, and then another #pragma rendermask for RSL code, or for GLSL code? It would be nice to have GLSL preview of the VEX shaders, but i'm not sure how if this is doable at all, or if i need separate shader files for each language. Edited January 6, 2009 by rendertan Quote Link to comment Share on other sites More sharing options...
edward Posted January 7, 2009 Share Posted January 7, 2009 One question though, about the .vfl files: is it possible to have a shader in more than 1 language in a .vfl file, i mean, can i use for instance, a #pragma rendermask VMantra and do the VEX shader code, and then another #pragma rendermask for RSL code, or for GLSL code? It would be nice to have GLSL preview of the VEX shaders, but i'm not sure how if this is doable at all, or if i need separate shader files for each language. In theory, the best we can have right now is either "OGL OGL2 VMantra" or "OGL OGL2 RIB" as your Render Mask. The code paths haven't tested too extensively but I just tried "OGL OGL2 VMantra" and it worked. Try this: - Start off with a New SHOP Material Type that uses GLSL. (ie. File > New Operator Type, etc...) - Now in the Type Properties, add VMantra to the Render Mask value in the first tab (Basic). - Now in the Code tab, enable VEX/RenderMan Shader toggle as well in the gear icon. Here's a file that hopefully works for you. In the viewport, it should be reddish while in Mantra it should be bluish. testDualShader.hip Quote Link to comment Share on other sites More sharing options...
rendertan Posted January 7, 2009 Author Share Posted January 7, 2009 In theory, the best we can have right now is either "OGL OGL2 VMantra" or "OGL OGL2 RIB" as your Render Mask. The code paths haven't tested too extensively but I just tried "OGL OGL2 VMantra" and it worked.Try this: - Start off with a New SHOP Material Type that uses GLSL. (ie. File > New Operator Type, etc...) - Now in the Type Properties, add VMantra to the Render Mask value in the first tab (Basic). - Now in the Code tab, enable VEX/RenderMan Shader toggle as well in the gear icon. Here's a file that hopefully works for you. In the viewport, it should be reddish while in Mantra it should be bluish. Hi Edward Thanks for the information and the file, going to take a close look at this, and hopefully add GLSL support to the previous shaders. Thanks once again. Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted February 5, 2009 Share Posted February 5, 2009 I am so using this diffuse term. Thanks dude! GW Quote Link to comment Share on other sites More sharing options...
rendertan Posted February 5, 2009 Author Share Posted February 5, 2009 I am so using this diffuse term. Thanks dude!GW You're welcome, altough i have to say that the majority of the work was Larry Gritz's, i just extended this based on those papers i mentioned earlier by Michael Oren, Shree Nayar, and Lawrence Wolff. I'll post some updated versions here soon, i'm playing with GLSL atm, hopefully to be able to add GLSL previews for this and future shaders (need to write a GLSL vim syntax file first though, but if anyone is interested in such things, there's a nice project, called QShaderEdit, by Ignacio Castano, which used to work at NVidia iirc, or did some work at NVidia, not sure atm, but the shader editor is quite nice, able to deal with Cg, ARB, and GLSL shaders). Quote Link to comment Share on other sites More sharing options...
Saber Posted May 23, 2009 Share Posted May 23, 2009 Good job man, i didn't hear that their is a new research for Orennayar. 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.