Announcement

Collapse
No announcement yet.

Cleanly fade 2d transparency on 3d objects Cinema 4d and V-Ray

Collapse
This topic has been answered.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cleanly fade 2d transparency on 3d objects Cinema 4d and V-Ray

    Hi,
    Sorry for starting a new topic and I haven't closed old topics yet. Too much work.
    I have another problem. I want to smoothly fade the object in the animation, without showing the internal structure - analogy to 2D fade. In Cinema 4D, in the native renderer it is possible. E.J. Hassenfratz showed it nicely in the tutorial, unfortunately the video has been removed from Vimeo. I wrote to him and got help immediately. He is a very nice man with great knowledge and empathy. I am attaching two 3D scenes. One of them is a way to fade objects in native Ciniema - this is the effect I want to achieve in V-Ray. The second is the V-Ray scene and unfortunately when the objects fade out you can see their backs. I work with CAD models (STEP import). These are often design assemblies. And the disappearance of such models composed of a large number of submodels during animation looks tragic. Does V-Ray allow for such an effect that can be achieved in the native Cinema 4D renderer?​
    Best,
    Krzysztof
    Attached Files
  • Answer selected by aleksandar.kasabov at 01-06-2023, 01:42 AM.

    Hi krzysztof_malec, yes this effect is achievable with V-Ray, by using the MultiSubTex combined with a SamplerInfo texture as ID generator. I'm attaching your sample scene modified with this setup (also seen in the image). The scene and example I give are with nodes, because they are better for understanding how this works, but this may be achieved with classic shaders too.

    Just to give a bit more explanation on the setup of the MultiSubTex
    1. You need the Mode as ID Generator Texture, because the transparency level is provided by the Sampler Info node.
    2. The first (and only) sub-texture must have an ID of 0, to only affect the first transparency level. Then you can have the user color texture as input to the sub-texture.
    3. The Default value needs to be black, in order for all other levels to be fully transparent.
    Click image for larger version

Name:	Cinema_4D_Y7G1nYkd4z.png
Views:	477
Size:	184.7 KB
ID:	1182352

    Unfortunately, this setup is not currently supported with V-Ray GPU and will only work with standard V-Ray. I will check if this can be supported on the GPU in the future, but it may take some time.
    Attached Files

    Comment


    • #2
      Hi krzysztof_malec, yes this effect is achievable with V-Ray, by using the MultiSubTex combined with a SamplerInfo texture as ID generator. I'm attaching your sample scene modified with this setup (also seen in the image). The scene and example I give are with nodes, because they are better for understanding how this works, but this may be achieved with classic shaders too.

      Just to give a bit more explanation on the setup of the MultiSubTex
      1. You need the Mode as ID Generator Texture, because the transparency level is provided by the Sampler Info node.
      2. The first (and only) sub-texture must have an ID of 0, to only affect the first transparency level. Then you can have the user color texture as input to the sub-texture.
      3. The Default value needs to be black, in order for all other levels to be fully transparent.
      Click image for larger version

Name:	Cinema_4D_Y7G1nYkd4z.png
Views:	477
Size:	184.7 KB
ID:	1182352

      Unfortunately, this setup is not currently supported with V-Ray GPU and will only work with standard V-Ray. I will check if this can be supported on the GPU in the future, but it may take some time.
      Attached Files
      Deyan Hadzhiev
      Developer
      chaos.com

      Comment


      • #3
        Hello Deyan,
        Thank you very much for your help, knowledge and work. I admire your work as Chaos developers. Unfortunately, I have Cinema 4D R20 Studio and despite native Cinema 4D node materials, I am unable to use V-Ray node materials for this version of Cinema 4D. Only from the R21 version is this possible. Also, if you can, please show this method for classic V-Ray materials. It's a bit of a shame that it's so complicated with V-Ray. In regular Cinema, all you need to do is enable the option in the TAG of the object.
        Best,
        Krzysztof

        Comment


        • #4
          Hi again, I'm attaching a version of the sample scene using classic materials and saved with R21. Unfortunately R20 is no longer officially supported so I can't save the scene with it, but I think you should be able to open the R21 scene.

          It's a bit of a shame that it's so complicated with V-Ray. In regular Cinema, all you need to do is enable the option in the TAG of the object.
          I agree that this effect is more complex to achieve than it ought to be and we may consider improving such workflow in the future.
          Attached Files
          Deyan Hadzhiev
          Developer
          chaos.com

          Comment


          • #5
            this is the first time ive heard of a method to do 2d transparency effects in vray.. maybe i missed it being discussed previously.. does the same technique work in 3dsmax?

            Comment


            • #6
              does the same technique work in 3dsmax?
              I am not a V-Ray for 3dsMax expert, but I think this approach is not directly translatable there, because the MultiSubTex implementation there does not have an ID generator input. Also keep in mind that this is not supported on GPU, which would also apply to V-Ray for 3dsMax, even if the input was available (as it is in V-Ray for Maya).
              Deyan Hadzhiev
              Developer
              chaos.com

              Comment


              • #7
                i shall ask on the max forums

                Comment


                • #8
                  super gnu - technically, if you need this effect only for the first transparency level, you don't need the ID generator input of the MultiSubTex node, as you can achieve the transparency value by simple float operations. You simply need to achieve the following expression: 1.0 - ([transparency_level] + [transparency])

                  Here is an example of the setup in V-Ray for Cinema 4D, and it should be replicable in V-Ray for 3dsMax:

                  Click image for larger version  Name:	Cinema_4D_tJvvCG0pVM.png Views:	0 Size:	642.2 KB ID:	1182469

                  A bit of additional explanation:
                  1. The invert node is necessary to actually have the opacity source, because using the expression above uses transparency.
                  2. The MultiSubTex in this example is only for the diffuse and is generally irrelevant.

                  Please do note that using the MultiSubTex approach (from previous posts) has the advantage of selecting an arbitrary transparency level (not only the first) by simply changing the ID of the sub-texture, while this expression approach works only for the first level.
                  Also note that this setup is affected by invisible lights in front of the objects, as they increase the transparency level.
                  Last edited by deyan.hadzhiev; 01-06-2023, 01:24 PM.
                  Deyan Hadzhiev
                  Developer
                  chaos.com

                  Comment


                  • #9
                    Actually, there is even a simpler method, given from the simplification of the expression above:
                    1.0 - ([transparency_level] + [transparency]) == 1.0 - [transparency_level] - [transparency] == (1.0 - [transparency]) - [transparency_level] == [opacity] - [transparency_level]

                    So effectively this is the setup where the Float A input is the actual opacity that will be used for the first level:

                    Click image for larger version  Name:	Cinema_4D_XsYurNQi6z.png Views:	12 Size:	556.1 KB ID:	1182504
                    Last edited by deyan.hadzhiev; 02-06-2023, 03:12 AM.
                    Deyan Hadzhiev
                    Developer
                    chaos.com

                    Comment


                    • #10
                      Thanks for your support (certainly more timely and enthusiastic than that on the max side!) however unfortunately, according to this:

                      https://forums.chaos.com/forum/v-ray...parency-effect

                      unlike C4D and Maya, the 3dsmax samplerinfo texture does not provide transparency levels as an output.

                      yay!

                      Comment

                      Working...
                      X