Announcement

Collapse
No announcement yet.

Glass + Scratches + HDRI = unexpected result

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

  • Glass + Scratches + HDRI = unexpected result

    Hi,

    We photographed some scratch textures and I wanted to implement them in a glass shader (For copyright reasons the scratches texture inside is another one, but basically the same way - white scratches on black background)
    A simple "Box" or kind of glass panel, in real measurements from the photographed texture.

    Now what I did:

    1) Assign Material IDs to different sides of the glass panel: 1 for front side, 2 for back side, 3 for the thin sides
    2) Make MultiSubMaterial, plug the same basic glass shader in each slot, modify one side (1) with the butmap texture in the bump slot.
    3) The material reacts as expected when I view the front side. But when I view it from the back side, THROUGH the "unscratched" side, there is NO effect AT ALL.

    That strikes me as strange. I don't know if it is an error on my side or a bug in VRay?

    Front (Where the scratches are mapped on):
    Click image for larger version

Name:	front.jpg
Views:	1
Size:	230.6 KB
ID:	884621

    Back (Where there are no scratches, but the other side should be visible through it):
    Click image for larger version

Name:	back.jpg
Views:	1
Size:	163.1 KB
ID:	884622

    The material setup:
    Click image for larger version

Name:	mat.JPG
Views:	1
Size:	51.8 KB
ID:	884623

    The max (2014) file (RAR5):
    https://www.dropbox.com/s/hwi8sb8cqf...tches.rar?dl=0
    Software:
    Windows 7 Ultimate x64 SP1
    3ds Max 2016 SP4
    V-Ray Adv 3.60.04


    Hardware:
    Intel Core i7-4930K @ 3.40 GHz
    NVIDIA GeForce GTX 780 (4096MB RAM)
    64GB RAM


    DxDiag

  • #2
    Never had a good experience with glass materials and multisubobject. Tried reproducing the steps, but I already get weird results with 2 same materials applied when I use fog inside the glass. When I remove the fog I get the results I want. But when I add a bump map like you did on one of the materials I experience the same problem as you do.
    Last edited by Vizioen; 19-05-2016, 08:03 AM.
    A.

    ---------------------
    www.digitaltwins.be

    Comment


    • #3
      Here are my quick tests.

      Click image for larger version

Name:	glass_1.jpg
Views:	1
Size:	493.2 KB
ID:	862097
      Click image for larger version

Name:	glass_2.jpg
Views:	1
Size:	487.6 KB
ID:	862096

      I wasn't paying attention very much and it seemed I switched the order of the images somewhat. But the point is: fog doesn't work and bump doesn't work in a multisub material. Or it's a physical thing.
      Last edited by Vizioen; 19-05-2016, 06:02 AM.
      A.

      ---------------------
      www.digitaltwins.be

      Comment


      • #4
        I got the result you had, with the same setup. It got fixed once I put Normal modifier in the stack and put on unify normals.
        Click image for larger version

Name:	1.PNG
Views:	1
Size:	440.3 KB
ID:	862100Click image for larger version

Name:	2.jpg
Views:	1
Size:	265.4 KB
ID:	862101

        Comment


        • #5
          That's quite unexpected, I started from a box, the normals should be good.
          A.

          ---------------------
          www.digitaltwins.be

          Comment


          • #6
            Originally posted by Vizioen View Post
            That's quite unexpected, I started from a box, the normals should be good.
            I know. I also started from a box. That didn't work, so I deleted all the sides except one to try a shell modifier. That didn't work either, but then the unify normals worked. I initially thought about making two boxes to simulate how windows insulate would work, and just use the map on one of them to get around this.

            Comment


            • #7
              Originally posted by oophus View Post
              I know. I also started from a box. That didn't work, so I deleted all the sides except one to try a shell modifier. That didn't work either, but then the unify normals worked. I initially thought about making two boxes to simulate how windows insulate would work, and just use the map on one of them to get around this.
              So I tried to reproduce this but no dice. Are your sure it's Unify Normals and not Flip Normals, because that kind of works for the bump, but I'm not sure the result is correct; In any case, fog is broke with 2 different refractive materials in a multi subobject material or something.
              A.

              ---------------------
              www.digitaltwins.be

              Comment


              • #8
                Originally posted by Vizioen View Post
                So I tried to reproduce this but no dice. Are your sure it's Unify Normals and not Flip Normals, because that kind of works for the bump, but I'm not sure the result is correct; In any case, fog is broke with 2 different refractive materials in a multi subobject material or something.
                I didnt save the scene, but I'm sure I used Unify. Could maybe try with a bigger box to see if its correct or not as that may be easier to witness in that case instead of a thin box.

                I didn't get fog to work in the multimaterial, it produced weird results, and only made one of the ID's colored.

                Comment


                • #9
                  Thanks for your input, I'll try the normals thing tomorrow. I also just have a regular box, no fancy modelling.
                  If this indeed breaks stuff I think we need a fix. How would I work around this issue if I had the task at hand to scratch one side of a glass panel and look backwards through it? Some developer input would be nice here.
                  Software:
                  Windows 7 Ultimate x64 SP1
                  3ds Max 2016 SP4
                  V-Ray Adv 3.60.04


                  Hardware:
                  Intel Core i7-4930K @ 3.40 GHz
                  NVIDIA GeForce GTX 780 (4096MB RAM)
                  64GB RAM


                  DxDiag

                  Comment


                  • #10
                    I can reproduce that on 3ds max 2016.
                    Unify normals also didn't help.
                    This seems to be a restriction of the MultiSubObject Material or a Bug.
                    I can imagine its the MSO Mtl. The object is not considered as one volume anymore or something like that.
                    But you can use the VrayMultiSubTex instead.
                    Turn off blending and swich to the face material ID mode.
                    You can use it directly with your texture in the bumb slot of a singe mateial.
                    And you can also use it as mask in a BlendMtl if you want to still have more than one material.

                    Fog is working as expected with this as far as I can say from my tests.
                    But it should propably have the same color and settings in all materials.
                    Since the BlendMtl is not able to blend volumes as far as i know. Beside of that one would need a place to set up this third axis of blending and there isn't anything like that.
                    The result proably would look wrong and unphysical if the fog and translucency settings differ.
                    Last edited by Ihno; 19-05-2016, 05:22 PM.
                    German guy, sorry for my English.

                    Comment


                    • #11
                      Originally posted by Ihno View Post
                      I can reproduce that on 3ds max 2016.
                      Unify normals also didn't help.
                      This seems to be a restriction of the MultiSubObject Material or a Bug.
                      I can imagine its the MSO Mtl. The object is not considered as one volume anymore or something like that.
                      But you can use the VrayMultiSubTex instead.
                      Turn off blending and swich to the face material ID mode.
                      You can use it directly with your texture in the bumb slot of a singe mateial.
                      And you can also use it as mask in a BlendMtl if you want to still have more than one material.

                      Fog is working as expected with this as far as I can say from my tests.
                      But it should propably have the same color and settings in all materials.
                      Since the BlendMtl is not able to blend volumes as far as i know. Beside of that one would need a place to set up this third axis of blending and there isn't anything like that.
                      The result proably would look wrong and unphysical if the fog and translucency settings differ.
                      Ofcourse! I keep forgetting about VrayMultiSubTex. Just tested this and works perfectly. Thanks Ihno.

                      Edit: tested this in Vray RT (CPU) and it doesn't show the bump, although it's supposed to be supported...hmmm
                      Last edited by Vizioen; 20-05-2016, 01:05 AM.
                      A.

                      ---------------------
                      www.digitaltwins.be

                      Comment


                      • #12
                        Tested it too, and it works, thank you!
                        For me it works with RT (CPU), too, so maybe your problem is somewhere else? I'm talking only of Bump, I dont use fog here.
                        Software:
                        Windows 7 Ultimate x64 SP1
                        3ds Max 2016 SP4
                        V-Ray Adv 3.60.04


                        Hardware:
                        Intel Core i7-4930K @ 3.40 GHz
                        NVIDIA GeForce GTX 780 (4096MB RAM)
                        64GB RAM


                        DxDiag

                        Comment


                        • #13
                          Originally posted by Art48 View Post
                          Tested it too, and it works, thank you!
                          For me it works with RT (CPU), too, so maybe your problem is somewhere else? I'm talking only of Bump, I dont use fog here.
                          Yeah I used a BerconNoise as a bump map. I forgot that it wasn't supported. Works fine with a regular noise/bitmap/...
                          A.

                          ---------------------
                          www.digitaltwins.be

                          Comment


                          • #14
                            So. Any reactions from ChaosGroup here? I mean the workaround is actually fine, but nonetheless - is this a max limitation or can we expect it to work some time down the line?
                            Software:
                            Windows 7 Ultimate x64 SP1
                            3ds Max 2016 SP4
                            V-Ray Adv 3.60.04


                            Hardware:
                            Intel Core i7-4930K @ 3.40 GHz
                            NVIDIA GeForce GTX 780 (4096MB RAM)
                            64GB RAM


                            DxDiag

                            Comment


                            • #15
                              I've added this issue into our system and will keep you posted.
                              Svetlozar Draganov | Senior Manager 3D Support | contact us
                              Chaos & Enscape & Cylindo are now one!

                              Comment

                              Working...
                              X