Announcement

Collapse
No announcement yet.

Disney's Principled BRDF implementation with OSL in Vray?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disney's Principled BRDF implementation with OSL in Vray?

    Would it theoretically be possible to write an implementation of Disney's Principled BRDF shader using OSL for Vray? I'm thinking this would be more efficient than building it by combining several BRDFs through a VrayBlendMtl... or at least it would have a cleaner interface to edit.

    Would this simply involve writing code for the various components (subsurface, metalic, specular, specular tint, roughness, anisotropic, sheen, sheen tint, clear coat, clear coat gloss) in OSL language? This would, I believe, result in a single BRDF shader, and as I understand it the Principled BRDF is actually several BDRFs mixed together. So I'm a bit foggy on that part as I am not sure of how to layer things using OSL. Is that possible in the Vray implementation?

    Wondering if anyone has tried this already?

  • #2
    It is possible, yes - we already have almost all BRDF components available in OSL (minus the back scattering, which is done slightly differently in V-Ray), so you just have to combine them together.

    The way Disney chose to combine the BRDFs is not energy conserving. For this reason, we will not be incuding it as a standard component in V-Ray. But you can certainly write an OSL version.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Thanks Vlado. Would you be willing to post the OSL code for the vrayMaterial? I did not see this among the examples provided, and for noobs like me it would be very helpful to see as an OSL example.

      Comment


      • #4
        Originally posted by vlado View Post
        It is possible, yes - we already have almost all BRDF components available in OSL (minus the back scattering, which is done slightly differently in V-Ray), so you just have to combine them together.

        The way Disney chose to combine the BRDFs is not energy conserving. For this reason, we will not be incuding it as a standard component in V-Ray. But you can certainly write an OSL version.

        Best regards,
        Vlado
        I understand the desire to have any Vray material be energy conserving which fits with the general philosophy of Vray to be physically accurate. One aspect of the Principled BRDF is that they do not use Lambertian diffuse. The VrayMaterial currently has a dropdown for several spec models (blinn phong, ward, GGX). Have you considered similarly updating the diffuse section of the VrayMaterial with a dropdown to choose between a Lambertian model and the diffuse model described in Disney's Principled BRDF paper? You could do this I think while still keeping it energy conserving.

        Comment


        • #5
          Originally posted by sharktacos View Post
          Have you considered similarly updating the diffuse section of the VrayMaterial with a dropdown to choose between a Lambertian model and the diffuse model described in Disney's Principled BRDF paper?
          No, haven't thought about it really. What kind of real-world materials would it be useful for? In any case, it is not too difficult to write a BRDF plugin for V-Ray that does any sort of BRDF that you need.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            Originally posted by vlado View Post
            What kind of real-world materials would it be useful for?
            They based their approach on observing multiple real world materials using the MERL 500 data set. In the paper they then describe how they used the observations from that data for their new diffuse/albedo approach. Here's an excerpt:

            As seen in the measured data observations, and based on our past studio experience, the Lambert diffuse model is often too dark on the edges, and adding a Fresnel factor to make it more physically plausible only makes it darker.

            Based on our observations, we developed a novel empirical model for diffuse retroreflection that transitions between a diffuse Fresnel shadow for smooth surfaces and an added highlight for rough surfaces. A possible explanation for this effect may be that for rough surfaces light enters and exits the sides of micro-surface features causing an increase in refraction at grazing angles.

            In our model, we ignore the index of refraction for the diffuse Fresnel factor and assume no incident diffuse loss. This allows us to directly specify the incident diffuse color. We use the Schlick Fresnel approximation and modify the grazing retroreflection response to go to a specic value determined from roughness rather than zero.
            This is followed by the formula for their diffuse model (which I can't cut and paste here)

            Speaking of tweaking the VrayMaterial, would it be possible to add a color to the GGX gamma? As you know, low values of the gamma (ie the tail falloff) are good for getting grazing angle spec (what they call "sheen" in the principled BRDF). Usually these are achromatic even in metals with colored spec like gold, however they observed that fabrics have colored glancing angle reflections. They surmise that this tinted grazing response in fabrics could be explained by the fact that cloth often has transmissive fibers which pick up the material color near object silhouettes. So if the VrayMaterial had the ability to tint the GGX tail falloff, this would help a lot in using it to simulate fabrics.
            Last edited by sharktacos; 22-06-2015, 12:38 AM.

            Comment


            • #7
              Originally posted by sharktacos View Post
              So if the VrayMaterial had the ability to tint the GGX tail falloff, this would help a lot in using it to simulate fabrics.
              I don't know if that's the right approach for achieving the effect. Cloth is very complex and there is no analytical BRDF that can fully describe the behaviour of different fabrics. We've scanned a lot of fabrics with our material scanner - some have such a weird behaviour that I've no idea how that can be described in any way other than scanning. For example, there are fabrics that show a pattern only when looked at from a specific angle, some can even show different patterns when viewed from different directions... I'll be showing an example of this at EUE.

              For the the moment I don't think we will try to tint the tail falloff. However you can experiment with layering three different GGX BRDFs with different colors and falloffs and see if that works for you.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment

              Working...
              X