Announcement

Collapse
No announcement yet.

How Anisotropy affects glossiness

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

  • How Anisotropy affects glossiness

    I am wondering how an anisotropic value affects a glossiness value in a material. While in Vray at a glossiness of 1.0 an anisotropic value of any scale doesn't have an influence, in other renderers the glossiness changes so that the anisotropic value has an influence. I assume this is because anisotropy itself means that highlights are not high-gloss to be able to be squeezed in x or y. Does anybody have a clue how this can be calculated mathematically, to which amount anisotropy contributes to glossiness / reflective roughness?
    Also, the anisotropic scale in Vray is linear, while in other packages it seems not to be. There, an anisotropic value of 0.1 is as high as a value of 0.5 in Vray.
    Would be happy if anybody of Chaosgroup could give me a hint.
    My goal is to code some scripts that achieve the same material setup in different render engines to improve our pipeline.

    Thanks in advance

    Robert
    Robert

    Max, VRay, Fusion:

    https://www.youtube.com/watch?v=g5fSLrVzpxg
    https://www.youtube.com/watch?v=bpmJgTb_9Ro

  • #2
    Robert, hello.

    I believe our way is correct, with anisotropy: if the specular has absolutely no spread, it couldn't spread along x or y (or uv/st...).
    I can't of course speak for others, but i don't think i lie when i say there are quite a few odd implementations out there, which bow to "ease of use" and leave correctness behind.
    For example, some renderer didn't have perfect gloss for a few complex BRDFs, and was capping max gloss to avoid fireflies in rendering, which in turn means anisotropy always has room to spread.
    In that case, you should ask them: we surely strive to keep things nice, linear and wholesome, but if their maximum gloss is 0.95 (as a wild guess/example) then you'd need to know (or manually verify.), and accordingly remap the incoming values to match.
    The same goes if their Anisotropy amount isn't linear: nothing we can do, or even could share, about how they do it.

    Sometimes shaders can indeed be matched, if with a degree of manual, painstaking labour, while many others they cannot: it's down to the level of error (between shaders) you feel you can afford.
    Having done a bit of it of late, with mixed results, i do have a bit of recent experience on this topic, so ask away if you need more, or if i wasn't very clear with this one.
    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


    • #3
      Dear Lele, thank you for your detailed answer.
      I have investigated and asked the support and they gave me some formula how the anistropy and roughness is mixed in their software. Unfortunately this is a result which doesn't help me a lot. Maybe you know more how to translate this into a vray-style anisotropy and roughness?

      Given that both values are just sliders, no texture:

      roughness = 0.1: is really linear and the inverse of the glossiness of vray, if no anisotropy is used, you can take values and invert them.
      anisotropy = 0.1

      roughness_result = float2(max(0.0, roughness - anisotropy), min(1.0, roughness + anisotropy))

      they return a float2-roughness, which results in my example in 0.0 in x and 0.2 in y direction. Rotation is not regarded here. For me this is not so clear, since now we have no roughness in x, but a twice as high roughness in y. Is it possible to have no roughness in x? Should this somehow be converted to vray?

      Concerning the scale of the anisotropy, I assume it is a logarithmic (exponential) function, in comparison with the vray anisotropy scale, but this can be solved later. If anisotropy influences roughness, it might be completely different. I found out that a anisotropy of 0.1 in their tool is quite similar to 0.75 in vray, with Ward BRDF.

      Can you help?
      Last edited by Robert1977; 01-06-2017, 09:02 AM.
      Robert

      Max, VRay, Fusion:

      https://www.youtube.com/watch?v=g5fSLrVzpxg
      https://www.youtube.com/watch?v=bpmJgTb_9Ro

      Comment


      • #4
        Some images would be helpful, as well as information on what that other software is... V-Ray's anisotropy is very close to standard GGX glossiness, which is very well documented so it should not be a problem to match it to other physically-based models.

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

        Comment


        • #5
          Hi Vlado,

          the other software is the renderer Stellar in 3DXCite Deltagen. It is an interactive renderer (progressive pathtracing?) that calculates the anisotropy with Microfacet distribution, that's what the developer told me.
          The golden sphere shown here is adapted materialwise, the white ball in the middle is not adapted yet. The lighting is in both scenes the same exact hdr-environment, no additional lights. The camera in both scenes is without exposure control so that the scene settings are the same. Diffuse and reflection color are blended different in both apps, I have compensated this already in the material, with a quite good result (not exact, but this might also be the camera or render method).
          I made some render tests and put down the values for both anisotropy and roughness in both applications, the results are not always exact, but quite similar. I have uploaded images that display the values and the render results (see attachments) . Does this help?
          I used Ward in Vray, since without anisotropy, the roughness in both applications is the same.

          Code from Stellar, that is used in their microfacet distribution:

          return float2(max(0.0, roughness - anisotropy), min(1.0, roughness + anisotropy));

          If you have any solution on how to convert the roughness and aniso, this would be great. For me not understoodable is, that in their application a roughness of 0.1 and aniso of 0.1 results in roughness.xy = float2(0.0, 2.0);

          Thank you much!

          Robert Click image for larger version  Name:	testscene_vergleich_vray_stellar_01.jpg Views:	1 Size:	486.7 KB ID:	954584
          Click image for larger version  Name:	testscene_vergleich_vray_stellar_02.jpg Views:	1 Size:	437.7 KB ID:	954585
          Click image for larger version  Name:	testscene_vergleich_vray_stellar_03.jpg Views:	1 Size:	452.7 KB ID:	954586
          Click image for larger version  Name:	testscene_vergleich_vray_stellar_04.jpg Views:	1 Size:	450.7 KB ID:	954587
          Click image for larger version  Name:	testscene_vergleich_vray_stellar_05.jpg Views:	1 Size:	430.9 KB ID:	954588




          Last edited by Robert1977; 02-06-2017, 07:56 AM.
          Robert

          Max, VRay, Fusion:

          https://www.youtube.com/watch?v=g5fSLrVzpxg
          https://www.youtube.com/watch?v=bpmJgTb_9Ro

          Comment


          • #6
            Ok, can you ask how they plug those values into the GGX formula?

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

            Comment


            • #7
              Hey Vlado, I will ask them, though I dont know, if they give me the information.
              Robert

              Max, VRay, Fusion:

              https://www.youtube.com/watch?v=g5fSLrVzpxg
              https://www.youtube.com/watch?v=bpmJgTb_9Ro

              Comment


              • #8
                Dear Vlado,

                while I am waiting for the answer from support of Stellar and don't know if they give me a reply, I would like to ask and maybe you could give me a hint:

                If they would use one of the following functions for anisotropy, how would this be translated to Vray anisotropy?
                Given a value of 0.05 for roughness and 0.1 for anisotropy, what would be the output values in Vray for the two different functions? I am using Ward anisotropy in Vray.

                But I don't know how the following term would fit within these functions, it does imply they are different. And roughness is the inverse of glossiness.

                return float2(max(0.0, roughness - anisotropy), min(1.0, roughness + anisotropy));

                In the following functions the roughness.x and .y are squeezed by anisotropy.
                The functions are from the following link:

                http://www.jordanstevenstechart.com/...ased-rendering

                _Glossiness("Smoothness",Range(0,1)) = 1
                _Anisotropic("Anisotropic", Range(-20,1)) = 0


                float NdotL = max(0.0, dot( normalDirection, lightDirection ));
                float NdotH = max(0.0,dot( normalDirection, halfDirection));
                float NdotV = max(0.0,dot( normalDirection, viewDirection));


                WardAnisotropicNormalDistribution(_Anisotropic,Ndo tL, NdotV, NdotH, dot(halfDirection, i.tangentDir), dot(halfDirection, i.bitangentDir));
                TrowbridgeReitzAnisotropicNormalDistribution(_Anis otropic,NdotH, dot(halfDirection, i.tangentDir), dot(halfDirection, i.bitangentDir));

                float WardAnisotropicNormalDistribution(float anisotropic, float NdotL, float NdotV, float NdotH, float HdotX, float HdotY)
                {
                float aspect = sqrt(1.0h-anisotropic * 0.9h);
                float X = max(.001, sqr(1.0-_Glossiness)/aspect) * 5;
                float Y = max(.001, sqr(1.0-_Glossiness)*aspect) * 5;
                float exponent = -(sqr(HdotX/X) + sqr(HdotY/Y)) / sqr(NdotH);
                float Distribution = 1.0 / ( 3.14159265 * X * Y * sqrt(NdotL * NdotV));
                Distribution *= exp(exponent);
                return Distribution;
                }

                float TrowbridgeReitzAnisotropicNormalDistribution(float anisotropic, float NdotH, float HdotX, float HdotY)
                {
                float aspect = sqrt(1.0h-anisotropic * 0.9h);
                float X = max(.001, sqr(1.0-_Glossiness)/aspect) * 5;
                float Y = max(.001, sqr(1.0-_Glossiness)*aspect) * 5;
                return 1.0 / (3.1415926535 * X*Y * sqr(sqr(HdotX/X) + sqr(HdotY/Y) + NdotH*NdotH));
                }


                Thanks and best regards

                Robert
                Last edited by Robert1977; 06-06-2017, 08:18 AM.
                Robert

                Max, VRay, Fusion:

                https://www.youtube.com/watch?v=g5fSLrVzpxg
                https://www.youtube.com/watch?v=bpmJgTb_9Ro

                Comment


                • #9
                  Ah, maybe the following term is the calculation of X and Y:

                  return float2(max(0.0, roughness - anisotropy), min(1.0, roughness + anisotropy));

                  so it can be removed from both functions above?
                  Robert

                  Max, VRay, Fusion:

                  https://www.youtube.com/watch?v=g5fSLrVzpxg
                  https://www.youtube.com/watch?v=bpmJgTb_9Ro

                  Comment


                  • #10
                    Dear Vlado, dear Lele,

                    is this the Ward-Anisotropy-Formula that Vray uses?

                    float WardAnisotropicNormalDistribution(float anisotropic, float NdotL, float NdotV, float NdotH, float HdotX, float HdotY)
                    {
                    float aspect = sqrt(1.0h-anisotropic * 0.9h);
                    float X = max(.001, sqr(1.0-_Glossiness)/aspect) * 5;
                    float Y = max(.001, sqr(1.0-_Glossiness)*aspect) * 5;
                    float exponent = -(sqr(HdotX/X) + sqr(HdotY/Y)) / sqr(NdotH);
                    float Distribution = 1.0 / ( 3.14159265 * X * Y * sqrt(NdotL * NdotV));
                    Distribution *= exp(exponent);
                    return Distribution;
                    }


                    If yes, I could try to adapt the values of Stellar to Vray (they calculate x and y different and I still wait for their formula input). What they told me, that they also use the Ward-Anisotropy-Formula. They send me a link to the following pdf:

                    https://pdfs.semanticscholar.org/330...178391b9fe.pdf (formula number 4), but I asked them also for a code example.

                    Thank you and best regards

                    Robert
                    Last edited by Robert1977; 08-06-2017, 03:03 AM.
                    Robert

                    Max, VRay, Fusion:

                    https://www.youtube.com/watch?v=g5fSLrVzpxg
                    https://www.youtube.com/watch?v=bpmJgTb_9Ro

                    Comment


                    • #11
                      Just for completeness, I got the solution, didn't need the ward-formula, only the functions for calculating x and y.
                      Robert

                      Max, VRay, Fusion:

                      https://www.youtube.com/watch?v=g5fSLrVzpxg
                      https://www.youtube.com/watch?v=bpmJgTb_9Ro

                      Comment

                      Working...
                      X