Announcement

Collapse
No announcement yet.

Two different materials on a transparent object

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

  • Two different materials on a transparent object

    Hello, I'm looking for some tips how to achieve the following:

    Imagine I have a glass on a table with simple clear outside but a bumpy structure on the inside. In different software, I would split the NURBS object into outside facing part and inside facing part, assign a clear glass material + bumpy glass material and render.

    If I do this, V-Ray gets confused because although the whole glass would be watertight, it's two separate open objects. So it renders an error, e.g. total dark.

    One idea I have is to do proper UV unwrap, but that would be very time consuming / impossible in some cases.

    Thank you

    Jonas

  • #2
    I read the description but don't quite understand what you mean. Do you have an image or sketch of what you want to achieve?
    https://www.behance.net/bartgelin

    Comment


    • #3
      Hello Bart, images are always better, so let me send you some images that illustrate my problem and a test scene. What I want to get is a glass A on the outside and B on the inside.

      https://1drv.ms/u/s!At-MP4X89ujTh8RN...d2ThQ?e=cEuxQA

      Comment


      • #4
        Hi Jonish,

        I experimented with the scene a little and you are correct - V-Ray does something funny when two different materials are used.
        The fix I was able to apply involves UV manipulation and a single material with a slightly more complex bump/normal map.
        Here's what I did:

        1. Ensure that the UVs of the inside and the ones of the outside are separated in the 0 to 1 UV square:
        Click image for larger version

Name:	UVs.jpg
Views:	330
Size:	536.8 KB
ID:	1163704

        2. Ensure that the normal map is split in two so that the stripes are visible only on the bottom halve of the texture like so (done procedurally):
        Click image for larger version

Name:	UVs_Bump.jpg
Views:	317
Size:	184.1 KB
ID:	1163705

        3. And the result
        Click image for larger version

Name:	UVs_Render.jpg
Views:	313
Size:	208.8 KB
ID:	1163706

        I'm pretty sure that your setup was supposed to do the same thing.
        That is why I'll speak to the developers and see what they think.

        Here's the file by the way - glass test (UVs).zip

        Konstantin

        Comment


        • #5
          konstantin_chaos Nice workaround, looks great.

          Also it would be great if two glass materials could be assigned per subobject selection. I tested it per VfR5 here but it doesn't work.

          Click image for larger version

Name:	Screen Shot 10-30-22 at 09.51 AM.jpg
Views:	253
Size:	134.9 KB
ID:	1163834
          www.simulacrum.de ... visualization for designer and architects

          Comment


          • #6
            Ok, I see the issue now.
            It is exactly the same as a problem I posted a long time ago, where I was wanting to use a bump for the back faces of a rear car
            brake lamp. I never got any response to that, so used other methods.
            Indeed, having to unwrap it does work but requires custom maps to split the surface, though is a good enough workaround for the
            simpler though seemingly unachievable 2 materials approach.
            https://www.behance.net/bartgelin

            Comment


            • #7
              Originally posted by konstantin_chaos View Post
              Hi Jonish,

              I experimented with the scene a little and you are correct - V-Ray does something funny when two different materials are used.
              The fix I was able to apply involves UV manipulation and a single material with a slightly more complex bump/normal map.
              Here's what I did:

              1. Ensure that the UVs of the inside and the ones of the outside are separated in the 0 to 1 UV square:
              Click image for larger version

Name:	UVs.jpg
Views:	330
Size:	536.8 KB
ID:	1163704

              2. Ensure that the normal map is split in two so that the stripes are visible only on the bottom halve of the texture like so (done procedurally):
              Click image for larger version

Name:	UVs_Bump.jpg
Views:	317
Size:	184.1 KB
ID:	1163705

              3. And the result
              Click image for larger version

Name:	UVs_Render.jpg
Views:	313
Size:	208.8 KB
ID:	1163706

              I'm pretty sure that your setup was supposed to do the same thing.
              That is why I'll speak to the developers and see what they think.

              Here's the file by the way - [ATTACH]n1163707[/ATTACH]

              Konstantin
              Hello Konstantin!

              Thank you for your answer, I tried your workaround before on a project and it didn't work, I didn't manage to get the mapping right and I got all desperate. Hopefully it was just some random glitch.

              It would be awesome if V-ray could render this correctly without UV mapping. I believed that IOR and refraction are properties of an interface between volumes, not of the volume itself, so I thought, why not, it should render properly, the rays bounce through as if it was a solid. But I guess it's not a random bug but a more complicated physics thing.

              Cheers

              Jonas

              Comment


              • #8
                An other idea, maybe it could be possible to apply local bumps structures per decal system.

                I tested it but it doesn't work yet, the base object isn't a closed object anymore. Also more projection types would be needed like cylindrical, ... .
                www.simulacrum.de ... visualization for designer and architects

                Comment


                • #9
                  Originally posted by Micha View Post
                  An other idea, maybe it could be possible to apply local bumps structures per decal system.
                  Yes, we have this working internally but it's not in the official builds yet.

                  Best regards,
                  Vlado

                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    Hi guys,

                    After an internal discussion it became clear that using two separate materials would never work.
                    The reason is V-Ray only calculates the correct IOR when the ray enters and exits the same exact material.

                    I also want to note that there is one alternative to the solution I showed earlier, one which does not require UV manipulation.
                    Here's the idea:
                    1. Split the interior surface
                    2. Assign Object ID (1 for example) from the V-Ray's object properties panel
                    3. Use a Multi-sub texture in the material's bump slot
                    4. Add two textures
                    5. Set the default bump/normal color in slot 0
                    6. Add the interior normal map in the second slot (ensure that the Transfer Function of the bitmap is set correctly)
                    7. Apply the material to both the exterior and the interior of the glass

                    Click image for larger version

Name:	MultiSubTest_01.png
Views:	255
Size:	1.36 MB
ID:	1164559

                    Comment


                    • #11
                      Originally posted by konstantin_chaos View Post
                      Hi guys,

                      After an internal discussion it became clear that using two separate materials would never work.
                      The reason is V-Ray only calculates the correct IOR when the ray enters and exits the same exact material.

                      I also want to note that there is one alternative to the solution I showed earlier, one which does not require UV manipulation.
                      Here's the idea:
                      1. Split the interior surface
                      2. Assign Object ID (1 for example) from the V-Ray's object properties panel
                      3. Use a Multi-sub texture in the material's bump slot
                      4. Add two textures
                      5. Set the default bump/normal color in slot 0
                      6. Add the interior normal map in the second slot (ensure that the Transfer Function of the bitmap is set correctly)
                      7. Apply the material to both the exterior and the interior of the glass

                      Click image for larger version

Name:	MultiSubTest_01.png
Views:	255
Size:	1.36 MB
ID:	1164559
                      Wow, thank you Konstantin for the new solution, this one sounds really cool.

                      So in case of refraction, two materials are a no-no, but the object doesnt have to be one watertight object, it can be split in two and each of them can have different object ID. Will note it down.

                      Have a nice day!

                      Comment


                      • #12
                        Hello konstantin_chaos, I was sure it worked before but now I'm trying it again, using RTX rendering and my good old RTX 2070 and multisub texture containing normal maps doesn't work. Only for CPU rendering.

                        Is this a known limitation? Does multisub not work at all with RTX or only in some cases / with some textures?

                        Also, second thing:
                        For lowering normal map texture intensity using RTX rendering and Mix textures, I had to create a neutral normal map texture, because mixing a normal map texture with a neutral color in the second slot doesn't work.

                        Thanks
                        Jonas

                        Comment


                        • #13
                          Hi Jonish​,

                          I think that what you've described is a limitation of the GPU engine.
                          I'll log the multi-sub texture thing for sure and test the second issue you've described a little more.

                          Thanks for bringing this to my attention,
                          Konstantin

                          Comment


                          • #14
                            Thanks, Konstantin!

                            And happy new year!

                            Comment

                            Working...
                            X