Announcement

Collapse
No announcement yet.

leaf translucency?

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

  • leaf translucency?

    As someone who is coming from mental ray after the recent Maya/Arnold situation, I'm going through things that I create quite often and trying them out in V-Ray. One of the things that I can't seem to figure out is leaf translucency...

    There doesn't seem to be any translucency parameter on the VRayMtl shader for maya.

    I found the vray2sided material, which seems like it should do the trick, but the translucency tex map doesn't act at all how anything translucent would when viewed from the side being directly lit as well as not giving me any control over the actual translucency value or color.

    When a leaf or piece of paper is viewed from the front (side being lit) you 99% of the time, can't see through it at all with the addition of direct light, and you certainly cant see what's on the back side of it unless it is super thin like onion skin or velum or newspaper. This seems to be how the vray2sided behaves and it's puzzling. For something like a leaf, you should see nothing but the front side in direct light.

    My issue it that i can't seem to be able to get translucency on the underside of my leaves and have the top surface not show though what's on the bottom. At the same time, I lose all shadows on the top surface if the translucency is high enough to make the underside look nice. In mental ray the translucency attribute respects the direct light hitting the top of the surface and only shows when looking at the backlit side, much closer to at least what I see in reality especially with things that are slightly thicker and translucent like leaves.

    Is there another way to go about this? Any tips or tricks would be appreciated.

    I've spent hour looking at every available thread on various sites, most seem to deal with Max.

    I know I said a lot, I can attach images if it helps explain the issues.


    I see turning off the double sided attribute gets a decent effect underneath the leaves, but it seems there is no control over the actual amount of translucency or color.
    Last edited by smbell; 26-10-2016, 11:15 PM.

  • #2
    It would help if you can attach images. From your description, the 2sided material should work exactly as you need it to.

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

    Comment


    • #3
      I've had some time to come back to this and play around with it and render a few images to show what I'm talking about. I've found several other posts around the internet where people are having the same results as well.

      So my go to mental ray shader (only bringing MR into it cause it's the only other renderer I know and I've used it for over 10 years) has a really simple setup, there is a translucency color slot and a translucency amount slot. This is on the shader level. I plug a two sided texture into my leave color with a front and back and the same texture into the translucency color. I can increase the amount to make the leaves more translucent like a maple, or less translucent like an oak. The transparency of the leaves is lowered slightly to allow light to filter into the tree interior making some nice bounced lighting.

      The branch on the left has light shining through the backside, the middle branch has direct light shining on top and the right branch has light coming through the topside of the leaves. The main thing here is that you can't see through the leaf that is only lit by direct light, which is almost always how things react to real light. Looking at the backside with sun coming through doesn't show the front side either. I've not been able to recreate this in Vray.

      Click image for larger version

Name:	MR_leaves_1.jpg
Views:	1
Size:	349.2 KB
ID:	866713

      What i'm running into with the vray2sidedMtl is that the translucency is not coming from the amount of light shining on the surface as it would on a real translucent object. The translency tex slot just blends the front and back materials together which you would never every want to happen. The force single sided attribute is letting some light though, but this is not controllable. When my supervisor says to make the leaves more translucent, I don't see a way to do that.

      Here's what I get in Vray:

      Translucency 0, you get the back side of the leaves as expected.

      Click image for larger version

Name:	VR_leaves_4.jpg
Views:	1
Size:	156.5 KB
ID:	866714

      Translucency 0.5 (most people that I've come across recommend using a 50% grey texture with black veins). Now i've got a slight bit of translucency, but I'm seeing the front side of the leaf blended though... why? You would never see the front side of the leaf, you would see the back side lit with the light from the front:

      Click image for larger version

Name:	VR_leaves_6.jpg
Views:	1
Size:	146.6 KB
ID:	866715

      Translucency 1.0, more translucency, looking better, but now I've got even more of the front side of the leaf showing through. This looks completely wrong.:

      Click image for larger version

Name:	VR_leaves_5.jpg
Views:	1
Size:	145.7 KB
ID:	866716

      I jacked up the color gain on the front and back, which increased the translucency, but at 1.0 translucency from the other side, the leaves are now showing the back side through:

      Click image for larger version

Name:	VR_leaves_7.jpg
Views:	1
Size:	217.8 KB
ID:	866717


      I found this page http://help.chaosgroup.com/vray/imag...leaf_tutorial/ which seems like some of the nodes in there are solving these problems, but this looks like it's ancient and I can't seem to replicate that in maya.

      I found this, which looks like max, I don't have a override shader:


      I know that this an old thread, but I find myself in the same spot and might be able to suggest a workaround.
      The 2sided material is far from perfect. The leaves look nice enough, especially against light - but the shader does not transmit light as it should. The shadows of the leaves are not influenced by the translucency setting of the 2sided material resulting in unrealistically dark spots.
      A potential workaround is:
      Use a Vray override material for the leaves. Use the 2sided material as base material (without any changes). Create a refractive version of a single side of the leaf (from the front or back slot of the 2sided material) - with "affect shadows" checked! Put this into the shadow slot of the override material.
      You can now control the amount and color of light passing through the leaves with the refraction settings of that shadow material. It's a tradeoff between softer, more colourful light beneath and inside a canopy and the contrast and definition provided by hard shadows.
      This response on Peter Guthries blog post about making leaves seems to come to the same conclusion I do:

      Haha thanks Peter! Good to know you think I'm not crazy. (I WAS starting to wonder.) If I'm using the normal 2sided material approach, I think there's an acceptable amount of blending and SSS somewhere around 96 gray. That's what I've been using so far.

      However, I'd love to see a material that worked flawlessly. I'm thinking it should be quite easy to program. The transparency factor could be ignored alltogether. You basicly never want to see a blend between front and back material. What you want to take into account is the difference in lighting between the front and the back. If the front material is more brightly lit than the back material (I'm talking viewing front/back here), there should be no blending. If the back material is lit brighter, the difference in brightness should be added to the front material. Also, I think there should be a slot for the SSS color, instead of using the front/back material diffuse color. Since a leaf's translucency color is mostly due to the green chlorophyll, it should be easier just having to set the desired SSS color, than having to take the diffuse colors of the individual materials into account.

      Sorry for the long winded post here, maybe I'm nuts or doing something really wrong, it just seems kinda weird. Thanks for taking the time to check it out.
      Last edited by smbell; 24-02-2017, 12:06 AM.

      Comment


      • #4
        I agree that vray 2 sided is probably not doing the job as one would expect. I also made posts about it. Even nested translucency is not coming out correctly.

        Can you post this branch with leaves scene I can take a look perhaps I can suggest a method.
        Dmitry Vinnik
        Silhouette Images Inc.
        ShowReel:
        https://www.youtube.com/watch?v=qxSJlvSwAhA
        https://www.linkedin.com/in/dmitry-v...-identity-name

        Comment


        • #5
          Originally posted by smbell View Post
          I found this page http://help.chaosgroup.com/vray/imag...leaf_tutorial/ which seems like some of the nodes in there are solving these problems, but this looks like it's ancient and I can't seem to replicate that in maya.

          I found this, which looks like max, I don't have a override shader:
          Override feature in V-Ray is not as a separate material but as s material attribute:
          https://docs.chaosgroup.com/display/...terialOverride

          Like Dmitry suggested please attach that scene for investigation, we might come up with a solution or at least we can use it as a reference point for improvement of the 2Sided shader.
          Svetlozar Draganov | Senior Manager 3D Support | contact us
          Chaos & Enscape & Cylindo are now one!

          Comment


          • #6
            Good post, I'm interested to see where it goes.

            I cannot get good results with 2sided either for leaves.
            Maya 2020/2022
            Win 10x64
            Vray 5

            Comment


            • #7
              I don't need trees right now but also interested in the next developments about this question.....Congrats on the academy win guys.
              https://www.artstation.com/damaggio

              Comment


              • #8
                I had a bit more time to mess with this and I discovered something quite by accident... If I reversed the front and back and set the translucency to 0.9 then I get light coming through and you don't see the other side, which apparently is why i was getting the results from my other images.

                I couldn't find any other combination of values that worked correctly with the front in the front slot and the back in the back slot. Weird.

                Here's a pic with them reversed with translucency 0.9, looks like it should:

                Click image for larger version

Name:	VR_leaves_11.jpg
Views:	1
Size:	185.1 KB
ID:	866925

                and normal 0.9:

                Click image for larger version

Name:	VR_leaves_9.jpg
Views:	1
Size:	187.2 KB
ID:	866926

                and normal 0.1:

                Click image for larger version

Name:	VR_leaves_10.jpg
Views:	1
Size:	187.1 KB
ID:	866923

                Weird, I'm trying it out with new shaders and new geo in a new scene to make sure i'm not being an idiot here. I did also double check the surface normals.

                Here's a link to the scene file if anyone wants to play around with it.

                https://drive.google.com/open?id=0B7...GtWTzZyT3JZV2M
                Last edited by smbell; 09-03-2017, 03:24 PM.

                Comment


                • #9
                  Sorry, what does "reversed with translucency 0.9" mean?


                  As opposed to "normal 0.9"?

                  Do you put the brightly coloured leaf in the front slot and the darker colour shader in the back slot?

                  If so, you are right - I get better looking trees this way too.
                  Last edited by snivlem; 09-03-2017, 03:32 PM.
                  Maya 2020/2022
                  Win 10x64
                  Vray 5

                  Comment


                  • #10
                    Never mind about the backwards thing. I wasn't seeing what I thought i was seeing.

                    This is the other side of the branch on the right in the first pic above with the sun shining through the backside (that looks ok from underneath).

                    Click image for larger version

Name:	VR_leaves_12.jpg
Views:	1
Size:	179.3 KB
ID:	866927

                    There is no way you would see the back through the front in direct light like that, it's bizarre looking. It's made worse by the fact that the leaf textures have quite a bit of contrast, but that's what they look like.

                    Sorry about the confusion. I was in a hurry when I posted the last time.
                    Last edited by smbell; 09-03-2017, 03:43 PM.

                    Comment


                    • #11
                      No worries.

                      I actually prefer the look of my trees swapping the back and front around. You get that "depth" which looks better. V-Ray trees look flat with compared to corona foliage. (100% my opinion only). But this way it gives the trees a bit of "punch". Not sure i care if it's scientifically wrong because it looks better.

                      Click image for larger version

Name:	2017-03-10 11_39_47-V-Ray frame buffer - [100% of 1500 x 1000].jpg
Views:	1
Size:	27.5 KB
ID:	866929
                      Maya 2020/2022
                      Win 10x64
                      Vray 5

                      Comment


                      • #12
                        So I had a look at your scene and found a few issues which I've corrected.

                        If you are using color management (which looks like you are) then you need to set your normal map to Raw, or else it gets incorrect shading / incorrect look.
                        I also think that if you put bump into both mtls you will get double bump so its better to apply a bump mtl at the end rather then bump in both mtls.
                        It looked like your front / back mtls were reversed, front was plugged into back and vise-versa.
                        I also checked your leave textures and there is an issue with them. The front / back textures do not line up, so the veins in the leaves are offset its creating a doubling effect. The same issue is for the normal map it only lines up to the front, you don't have one for the back, regardless I don't think it would work correctly either way (perhaps Vlado can chime in) but you can't have two normal maps for front / back on one normal of geometry.

                        With that said, I still don't think 2sided mtl works properly. Besides the example I made in another post (with papers), same problem exists here. Some leaves just render really dark, even though they should be bright as they are directly illuminated. Also the shading is very sporadic, if I use multiply by diffuse color they become very dark, without it they are very washed out.

                        I have all my lights at a normalized value so nothing is extra bright or over exposed.

                        If you look at the red/green image where I just colored front mtl red and back mtl green, I would imagine when looking from below you would see a lot more of the back side (green) with sss in it, rather then predominant red? Now at mix of 50% the red is much stronger so its washing out the color because its also more reflective at the top, but that reflection is more evident along with the front mtl. And look at the green leave in the corner, its angled and its getting a more stronger green there, why? Its also facing to us with its back
                        ...anyway







                        Also below are the reference images I shot today of the plant I have in the kitchen. Imho its nearly impossible to get such look with 2sided mtl right now (I could be wrong tho) but I have to render a lot of leaves all the time, and its a challenge.



                        Last edited by Morbid Angel; 11-03-2017, 06:31 PM.
                        Dmitry Vinnik
                        Silhouette Images Inc.
                        ShowReel:
                        https://www.youtube.com/watch?v=qxSJlvSwAhA
                        https://www.linkedin.com/in/dmitry-v...-identity-name

                        Comment

                        Working...
                        X