2008-06-11

Translucent leaves

I have been using v-ray for several years but just recently switched to mental ray. If you haven't used mental ray since Max 8 I highly recommend trying the Arch & Design shaders. Continuing to experiment with the A&D shader, I wanted to explore the translucency features. If used properly the results are actually quite convincing.


Translucent leaves


I wanted to create a leaf material that worked similar to how they are perceived in reality. If a leaf is front lit they seem very opaque and specular, but if it is back lit suddenly they take on totally different properties including translucency. I wanted to capture this and apply it to a tree.









With the A&D material, translucency is a factor of the transparency. You will only see the effects of translucency if transparency is higher than 0.0, and you will see the greatest effect if it's cranked up to 1.0.









So I set transparency to 1.0, and to keep it from refracting, I changed the IOR to 1.0 (vacuum). Also to keep it from being transparent I put a Two-Sided base into the color slot. This is what makes the translucency more believable. Of course I turned on Translucency and the value is controlled by an image. For the color of the translucency I chose a light green color based on what a leaf looks like when it's back lit.




The Two-Sided base that controls the transparency value allows each side of a face to take on different properties. For the front side, I didn't want any translucency so the transparency value is black/off. For the back I wanted the translucency to be strong so the value of the transparency is on and controlled by a gray-scale map of leaves. This keeps the leaves from being transparent.

Here is a max file (max 2008) that has a shader with the translucent properties. Just place the appropriate texture maps.

16 comments:

  1. hi,

    again, congratulations for use mentalray render and for the tips.

    can you share a example file of this material ?

    thx, again

    regards,

    paul

    ReplyDelete
  2. Hi again...

    i make the material, just as you did, but i can´t make it work in a simple scene ..?

    can you share some example file with this material aplied to a object ?

    thx for help,

    regards

    paul

    maildots@yahoo.es

    ReplyDelete
  3. again...thanks for help,

    regards

    paul

    ReplyDelete
  4. you have an excelent resource here in your blog. glad i found it. keep up the good work.

    ReplyDelete
  5. It's really great tip!
    Can U also share what tree plugin do U use?

    ReplyDelete
  6. the tree was not a plug-in...just simple meshes with planes and opacity maps for the leaves.

    ReplyDelete
  7. Oh, I was asking because it is very similar to speedtree.
    Great work! Thx alot.

    ReplyDelete
  8. Ramy,

    You mantion using a greyscale image of the leaf for the transparancy. Did you cut out the leaf and then greyscale it and put a white or black background on it or did you simply greyscale the original bitmap? I'm using xfrog trees so my main map is a green background tif.

    Thanks,

    Patrick

    ReplyDelete
  9. Good question. The background is black, the leaves are greyish white, and the leaf stems are black as well. So the only thing that is grey or white is the part of the leaf that I want to glow.

    ReplyDelete
  10. Ramy,

    Thanks for replying. I tried it last night with a copy of the original tif, cut out with it's alpha channel / converted to greyscale and then added a black background.

    The fg pass was it's usual amount of time but when rendering as soon as it hit the tree it grounded to a halt and was taking forever.

    I guess transulcency is a big chunk of time and as my image is a dusk shot I'm going to skip it. I'll try it again on a daylight scene and see if it renders faster.

    ReplyDelete
  11. In the .max file you do not include an opacity map, only the 2-sided material and checker material. I do appreciate the push in the right direction, but I can't figure out at all, how to get the opacity to work with my image.

    What ends up happening is the minute I turn on the translucency, the opacity map is ignored, and the entire plane turns to the translucent colour. If you could explain, or include a .max file that has the leaf image, that would be awesome!!!!

    -Adam D.
    liquidmotive@hotmail.com

    ReplyDelete
  12. In 3d max 2011 the Two-Side base doesn't exist! how can I do a 2-sided material?

    ReplyDelete
  13. I know...Autodesk dropped it from the UI. It still supports it though. Just open an old file that uses the map into 2011, and you'll see it there. I'm sure you can "unhide" it from one of the .mi files but I'd have to look for it.

    ReplyDelete
  14. Rammy

    I like the technique but I am in the same position as the post above Two-Sided doesn't exisit in 2011. Did you have any ideas on how to unlock it?

    Alan

    gaffer1961@hotmail.com

    ReplyDelete
  15. Check out my latest post on the two-sided map:
    http://3dsmaxrendering.blogspot.com/2011/04/two-sided-map-is-gonenot-really.html

    ReplyDelete