Announcement

Collapse
No announcement yet.

Mapping glossiness distribution?

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

  • Mapping glossiness distribution?

    Hi, I have a gradient ramp driving the reflectivity of a material:
    http://forums.chaosgroup.com/showthr...-falloff/page5

    It's a bitmap gradient that basically has a (reflection) colour per angle, left in the bitmap is 0 degrees incidence and right is 90 degrees.

    This works well for smooth surfaces, but I'm wondering how the distribution would change if the material has glossiness applied. Theoretically with a rougher surface a value at for example 45 degrees would have values from other degrees around it mixed in as the sample would have have a number of differently oriented microfacets in it. Meaning that the lower my glossiness setting is, the more blurred my gradient becomes.
    Is there a way to mirror the glossiness distribution of for example ward or blinn in my gradient?

    Click image for larger version

Name:	fresnelgradient_screen1.JPG
Views:	2
Size:	78.6 KB
ID:	881658

    Thanks!
    Rens
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

  • #2
    Originally posted by Rens View Post
    Theoretically with a rougher surface a value at for example 45 degrees would have values from other degrees around it mixed in as the sample would have have a number of differently oriented microfacets in it. Meaning that the lower my glossiness setting is, the more blurred my gradient becomes.
    Ideally, that's what happens, yes (it's called glossy Fresnel or something).

    Is there a way to mirror the glossiness distribution of for example ward or blinn in my gradient?
    You can't do that with a map - the BRDF shader needs to take into account the light vs viewing angle internally, while calculating the illumination and reflections. So f.e. reflections coming from close to the mirror direction will be yellow, and ones at side angles will be white.

    It is on the "to do" list to look into glossy Fresnel, at least as far as the built-in one in the V-Ray material is concerned. However mapping that with an arbitrary texture is more complicated and I don't have a clear idea how to approach this yet.

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

    Comment


    • #3
      @Rens: This is how Maxwell works. I've never quite understood that but your explanation makes perfect sense. As the roughness increases, the fresnel curve "relaxes". So a material with 100% roughness (0 glossines in Vray), has a perfectly flat fresnel curve.

      @Vlado: Doesn't this effect complicates masks in VrayBlendMtl? Somehow view dependent maps should take into account the roughness of the layered shader. Maybe Vray could implement a VrayFresnel which could have the microfacet model and roughness as parameters too. But in case of a nested VrayBlendMtl this might not be ideal.

      -Eugenio

      Comment


      • #4
        Originally posted by Midiaeffects View Post
        @Vlado: Doesn't this effect complicates masks in VrayBlendMtl? Somehow view dependent maps should take into account the roughness of the layered shader.
        I've wondered about that too, but I don't have a meaningful answer just yet I guess we'll see when we get to implementing the glossy Fresnel.

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

        Comment


        • #5
          Thanks for the replies! : )

          Originally posted by vlado View Post
          You can't do that with a map - the BRDF shader needs to take into account the light vs viewing angle internally, while calculating the illumination and reflections.
          Just considering ray traced reflections I don't think this is the case here, please correct me if I'm wrong.

          The glossiness itself is handled by the material. What the ramp I described basically is, is a reflection filter. In other words the blend texture between a 100% reflective material and a diffuse base.
          The ramp is driven by a falloff, where the only variables are the camera normal and the surface normal. So, in the case of a rougher surface where the surface normal is an average of many different angles, the resulting reflection filter would be an average of many different angles.

          For example the following setup:
          A sphere with a VRayMtl set to 100% reflective with Fresnel on and a Normal Bump map in the bump slot with this OSL tex.
          Code:
          /* 
          randomNormal_v001_rh
          created 2015-05-09 (rh)
          mail@rensheeren.com
          
          Outputs a random noise for use in normal maps.
          */
          
          shader randomNormal_v001_rh
          (
                  float noise_scale = 1.0,
                  output color result = color(0.5,0.5,1.0)
          )
          {
                  point p3Noise = noise(P/noise_div);
                  color cColor = noise( "cell", P / noise_scale);
                  cColor[2] = 1.0;
                  result = cColor;
          }
          If you vary the Normal amount in the Normal Bump the reflection filter will change as V-Ray will sample for many different normal orientations. For the attached image I've varied the amount from 0 to 4.5.

          Basically, if I had a (falloff) gradient as the reflection filter it would go from black to white at 0 and be pretty much uniformly grey at 4.5. The question is what would be good match for the Blinn/Ward/etc. glossiness distribution, or am I missing something here and it's not possible at all?

          As for how a blend texture could work, I'm thinking a map where you have the same BRDF dropdown as in the VRaymtl plus the same glossiness spinner and map slot, which you could then instance.


          @Midiaeffects: Yep that's the idea!


          EDIT: Just reread you reply Vlado, I guess the question is if the BRDF always needs to consider lights as well to calculate the glossiness in the case of a reflection filter.
          Attached Files
          Last edited by Rens; 09-05-2015, 07:29 AM.
          Rens Heeren
          Generalist
          WEBSITE - IMDB - LINKEDIN - OSL SHADERS

          Comment


          • #6
            Edit:

            Oh, never mind. at the fifth reread, i got what you meant, and yeah, I think it needs a fully fledged BRDF: we have no access to the microfacets, and simulating those with fine bumps is SERIOUSLY not a very good idea (particularly if you plan on an animation, rather than a still).
            In your OSL sample above, for the noise size you chose, the image would likely never clean: the noise is way too frequent (many variations per pixel), and on top of that it's not filtered, so the stuff would flicker per frame like mad.
            If you opted for filtered bitmaps, then the filtering would insure you had really no microfacets at the avail, as the target for the mipmap would be the pixel, and the effect would likely lose any interesting detail (but hey, do try it out.).
            Attached Files
            Last edited by ^Lele^; 18-09-2015, 01:19 AM.
            Lele
            Trouble Stirrer in RnD @ Chaos
            ----------------------
            emanuele.lecchi@chaos.com

            Disclaimer:
            The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

            Comment

            Working...
            X