Announcement

Collapse
No announcement yet.

0-1 Fresnel IOR does not match IOR mapping

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

  • 0-1 Fresnel IOR does not match IOR mapping

    Hi,

    I've came across a problem that prevents me baking procedural shaders on my model.

    Basically, my workflow is to create procedural wear and tear using VrayDirt, and use its mask to mask out various material attributes. My workflow for metal materials thus far was mapping also IOR slot of V-RayMTL with it, using Dirt as a mas to blend between two output maps, which have IOR set as output amount.

    I've encountered a problem with texture baking, because textures have to be in 0-1 range. Luckily, V-Ray supports metalness workflow via 0-1 Fresnel IOR range. So what I did is I have unplugged my map network from IOR slot, replugged it into Fresnel IOR slot, and disabled fresnel IOR lock. Then I have proceeded to change output amount of my fresnel output nodes, by doing 1 divided by IOR value. So for example when masking IOR 6 and IOR 1.6, i've arrived to output amounts 0.167 and 0.625.

    Then problem I have is that the two simply do not match. I have no idea why, but results are very different:

    This is how it looks with IOR slot mapped with regular output amount values:
    Click image for larger version

Name:	IOR.jpg
Views:	1
Size:	457.3 KB
ID:	886027

    And this is how it looks with Fresnel IOR slot (and Fresnel IOR unlocked) and values converted to 0-1 range:
    Click image for larger version

Name:	Metalness.jpg
Views:	1
Size:	448.5 KB
ID:	886028

    I am really sad and stuck here

  • #2
    Yep, something's definitely wrong here. Not even complete black matches reflectivity of IOR 6 when mapping IOR channel with HDR values :/

    Comment


    • #3
      I made even nice comprehensive repro scene:

      Click image for larger version

Name:	IOR_vs_Fresnel.jpg
Views:	1
Size:	108.2 KB
ID:	864466

      Click image for larger version

Name:	IOR_vs_Fresnel_Graph.jpg
Views:	1
Size:	103.6 KB
ID:	864467

      Metalness_vs_IOR_V2.zip

      (Scene is Max 2016 + V-Ray 3.5 beta1)
      Last edited by LudvikKoutny; 03-12-2016, 07:32 AM.

      Comment


      • #4
        Another update:
        When I plug those colors individually into Frensnel IOR slot, they work as they should. It is only when they go through that Mix map that they break. I've tried to use Composite map instead, but got same result :/

        Comment


        • #5
          could be a gamma correction issue?

          Comment


          • #6
            Originally posted by bardo View Post
            could be a gamma correction issue?
            Nope. That would mean also the color inputs alone would not produce correct fresnel IOR, but they do. They do not produce correct result only when they go through mixing maps.

            Comment


            • #7
              To get identical result you need to invert the Sources of the VRayCompTex nodes. The 1/10 node should look like 10/1 =10 and 1/1.4 should look like 1.4/1. In your case it is set like 1/10 = 0.1
              Zdravko Keremidchiev | chaos.com
              Chaos Support Representative | contact us

              Comment


              • #8
                Originally posted by Zdravko.Keremidchiev View Post
                To get identical result you need to invert the Sources of the VRayCompTex nodes. The 1/10 node should look like 10/1 =10 and 1/1.4 should look like 1.4/1. In your case it is set like 1/10 = 0.1
                I am not sure I follow. If I did what you said, I would end up with HDR values again... I would not need to do any division at all then. Why would I do extra op to get the same number?

                The reason here is that I need to get fresnel IOR values in 0-1 range. In V-Ray, frensnel IOR slot accepts also a value in 0-1 range, where it maps Fresnel IOR values in an inverted range. For example to get Fresnel 1.6 in 0-1 range, you do 1/1.6=0.625. And if you then create white color, multiply it's RGB level with a value of 0.625 and plug that into the Fresnel IOR slot, you will indeed get a result indentical to Fresnel 1.6. The problem I am talking about here is that while individual 0-1 range maps do work in Frensnel IOR slot, if they are mixed using Mixing map, like Mix or Composite, it stops working correctly.

                I need metalness map in 0-1 range to feed it into a game engine that does not support metalness maps with HDR values.

                Comment


                • #9
                  Originally posted by Recon442 View Post
                  I've encountered a problem with texture baking, because textures have to be in 0-1 range. Luckily, V-Ray supports metalness workflow via 0-1 Fresnel IOR range. So what I did is I have unplugged my map network from IOR slot, replugged it into Fresnel IOR slot, and disabled fresnel IOR lock. Then I have proceeded to change output amount of my fresnel output nodes, by doing 1 divided by IOR value.
                  If you are going to do that, you will need to set the refRaction IOR to 1.0. Then it should match. Or you can use the VRayAlSurfaceMtl material. Or, leave the Fresnel IOR value locked and assign the result to the actual refraction IOR slot.

                  Best regards,
                  Vlado
                  Last edited by vlado; 05-12-2016, 08:03 AM.
                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    Nope, unfortunately it does not work :/

                    It behaves very weirdly. If I have unlocked Fresnel IOR from Refraction IOR, refraction IOR still does something, but it does not fix the problem at all. Using Refraction IOR instead of reflection exhibits exactly same behavior. It still does not work correctly. Swapping IORs in Mix will make IOR high enough, but it does not work when mix is the other way around:

                    Here's a video:
                    https://www.youtube.com/watch?v=wAg73-LYzT8

                    I have also tried different approach, and divide entire resulting HDR mix by 1 to get 0-1 range. And it does produce different result, but it does not produce correct result:
                    Click image for larger version

Name:	Mix2.PNG
Views:	1
Size:	177.8 KB
ID:	864484

                    Here's a video which showcases that individual colors are set up correctly, but it's a mixed result that breaks something:
                    https://youtu.be/1wEMnKNaOho

                    Basically, all I want is to have the right shaderball matching the left one, but using fresnel reflection input that's in 0-1 range

                    It also seems that if Fresnel IOR is unlocked from Refraction IOR, even Refraction IOR slot still somehow affects reflection IOR, showcased on a video here:
                    https://youtu.be/NIxiUyuph2A

                    I just discovered a few new confusing behaviors, but none of them fixes the problem.

                    Comment


                    • #11
                      Okay... I've narrowed it down. If i use pretty much any texture as a mix amount, be it checker, or noise, it works. The result is identical. The difference is specific to using VrayDirt as mix amout. Which still doesn't save me as VrayDirt is the main driving force of my procedural shaders, but at least I know where exactly does the issue occur

                      SO... When mixing two fresnel values with VrayDirt map, something breaks, but only in case of mixing then 0-1 range values. When mixing HDR values, everything is correct.

                      Comment


                      • #12
                        That's a bit weird, can you attach some samle scene for me to check?

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

                        Comment


                        • #13
                          Are you maybe running into a shader cut-off somewhere?
                          It'd be less apparent, or gone, if the values where higher, likely, depending on what the map drives (f.e.: reflection).
                          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


                          • #14
                            Actually, I take that back. Only checker works as it has only absolutely white or black values. If i use anything else, it still does not work So I am sorry, that was my mistake, it is not specific to VrayDirt.

                            Scene is attached in a second post http://forums.chaosgroup.com/attachm...7&d=1480775525

                            Lele:
                            What do you mean by shader cuttoff? I tried clamping some maps here and there, but it had no effect, if that's what you mean.

                            Comment


                            • #15
                              Any news on this?

                              Comment

                              Working...
                              X