A tutorial on making leaf materials for 3d trees, in this case a sugar maple (in autumn).
Firstly, some observations on opacity mapped leaves vs. geometry leaves. As you can see in the image above, the images in this post were made using opacity mapped leaves. After some tests on my farnsworth house project, I have come to the conclusion that it is quicker in most cases to use opacity mapped leaves. Its true that in simple scenes trees with geometry leaves may render quicker as VRay doesnt have to calculate the opacity of thousands of leaves, but in dealing with complex scenes with millions of polygons the advantage in using (a lot) less RAM is huge. The processes involved in swapping opacity mapped plates for geometry are also very long winded and very tedious!
Exporting from Onyxtree. I went with 4 polygons per leaf so that the leaves aren’t just flat. Remember to set the dimensions you want the individual leaves, and change the units when you export. You can also make it export 3 different leaf IDs with varying sizes. I normally export as a .obj file.

Opacity mapping. It’s important to make sure the opacity map is just pure black or white, with a sharp edge. The opacity map I used can be found here (its not a great example!). You should also turn off filtering in the bitmap loader options (screenshot).

As imported to 3dsmax and given grey materials.
VRay2sidedMtl. The vray 2 sided material works best with geometry that has no thickness, which is what onyxtree outputs. It is a very quick way of generating a SSS (sub-surface scattering, think candle wax, skin, milk etc) type look. The image below is rendered using a vray2sidedmtl on all leaves with grey submaterials and a hand drawn image for the vein skeleton.
Front material. The front side material is a basic vraymaterial with a diffuse map and a reflection map. Click here for front vray material set up. The color correction map is to produce slightly different hues of leaf for each of the 3 sub leaf types (you should have got a mult-subobject material when you imported the .obj file). I usually make the first leaf and then copy and paste it to the 2nd and 3rd and just change the hue value slightly. The diffuse map looks like this, and the reflection map is a b&w copy with levels adjusted to make it more contrasty.

Render showing front leaf material on both sides with no transparency.
Back material. The back material is a copy of the front material but with a different diffuse bitmap and not quite as reflective. Note that I overlaid the veins skeleton jpg on top in photoshop as well. (without it, the veins looked too light when viewed from the underside as they took 100% of the lighter back material)

Render showing 2sided material with correct front/back materials but no transparency.
Finished result Click image for 800px version. Rendered using vrayphysicalsky and sun, and a vrayphysicalcamera.
Tags: leaf, leaves, tree, vray, vray2sided




@jonathan beautiful image!
@luis think you are getting ahead of me now! I haven’t got as far as playing with animating these trees…
Hi man, I remember a while ago that vray took a bit longer to deal with opacity than if it just had a texture slapped on top of the onyx trees. So my questions are:
If I have a large scene, will it take longer to render trees with this method?
Will it be more convenient to use a 2 sided mat but with simple colors?
I can see some transparency of the leaves in your render, this is normal with a 2sidedmat?
Thanks
Nothing? :O
you’ll just have to test and see, but in my farnsworth house scene opacity mapped leaves were much quicker as the memory usage was much lower. (I have 12gb and the farnsworth house scene was using all of it with non opacity mapped trees). the 2sidedmaterial is just a clever material that looks like it has SSS (not transparency)
OK, thanks
will do some tests!
Thank you! Great for sharing! Amazing Job.
Luke from Brazil.
For all those following this post, check out vray.info, they have this tutorial but with a max 2009 scene as well.
Hi Peter, i have a scene that is gonna require about 12 high rez v-ray proxys framing my scene with wind, its taken hours to export them as proxys and anim data, just wondering if texturing like this with 2sided is going to cause a massive rendering time problem. Can you prescribe and other options if this is going to be the case?
Can you prescribe ‘another’ option, i should say!
The end result is really awesome. And for a closeup like this its impressive !
I looked at the maps and I was even more impressed with the result you can get with such maps (not really highres)
I need to try to make a tree using this tech
Thanks for sharing
Fantastic tutorial - thank you for sharing!
Heya Ptere, great tutorial as usual!!
Just one question. How do you export the leaves to look as your one looks like(plane) and not actual leafs, cuted out etc. I cant get it to work :/
darius..
in the export panel you click on plates and set it up there
peter…
any chance of a thorough onyx tute? onyx seems to be a bit of a crap shoot with what it decides to do.
Hi Patrick, I could try I guess, but I’m not that great at it either!
I always start with a preset, then start with the trunk (turn preview of everything else off), then primary branches, then work through to leaves. Having a photo of what you are trying to achieve next to you helps a lot.
Hi peter, thanks for the tut, but what type of transparency are u refering to in the last picture?, is it refraction, what are your settings? and is it only in the back mat??
hi peter, im wondering the same things rick, what transparency are you referring to? i can’t seem to figure out what setting needs to be turned on so the leaves are transparent. thanks.
Just wondering why you prefer to export as obj rather than 3ds as the files are about 5 times the size? Cheers
Hi Peter, i have this excellent tutorial for a while, and i’m managing now to use it today.
My remaining question though is the same than Rick:
In the “Render showing 2sided material with correct front/back materials but no transparency.”, it’s ok, but the next render shows the result with transp. or SSS (?) without explanation. Lately you say “the 2sidedmaterial is just a clever material that looks like it has SSS (not transparency)”, The info beetween those 2 last renders is missing, what have you done really for the final result?
Hope i can resolve this today
Thanks in advance, David.
Forget my silly question, i just didn’t watch it twice, and didn’t push the “older comments” button… oops
So now that’s ok for me, again thank you
You made a wonderful blog, Peter!
You wrote: “The processes involved in swapping opacity mapped plates for geometry are also very long winded and very tedious!”
I would like attempt that to create a blossoming Cherry tree. I have Onyxgarden, but in the latest version it can’t do “replace leafs” anymore. If there is any way to get a custom flower geometry onto a tree, I would be grateful for any keywords I can go on with.
Thank you
Felix
@Felix, there is a script somewhere on the chaosgroup forum that I used, but as I said, it takes a long time and I dont recommend it. (http://www.chaosgroup.com/forums/vbulletin/showthread.php?32898-Tool-to-convert-opacity-mapped-faces-into-geometry-leaves)
Very cool site! Thank you so much for your effort in writting this.
great tutorial! but i have a question why i have no number of p-objects , with variable scale and length witdh options in leaf plates?
Thanks
i cant change that option why?
Hi would you mind letting me know which webhost you’re utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot faster then most. Can you suggest a good internet hosting provider at a honest price? Kudos, I appreciate it!
@cartransportreviews I leave all that stuff to my web guy!
thank you very much peter, great tutorial!!!!!!!!
hi, i have the same question as donald, do you think that there’s some possibility to have trees with differents sizes( number of p-objects - with variable scale) under onyx tree format (*.bro) instead (*.obj); because I can’t change it under a 3dsmax + tree storm plugins, cordially
Thanks for sharing.. I learned the grass setup from your grass tutorial as well which was amazing and neatly explained and sp is this.
the opacity is expensive to render, for large scenes I just use instances and proxies, and they are fast to render and light on ram. the problem though is creating leaves that look good enough with just geometry… because to make a good looking,detailed leaf with geometry can get high poly and that’s just not acceptable. so for hi quality leaves that should look great from up close… I go with opacity mapping.
Peter thanks for this great tutorial, save me hours.