Remember Me

German mr Forums

Recent Uploads

Hot Downloads

Most Popular

Home Jeff's Blog Faster foliage renders
Faster foliage renders PDF Print E-mail
Written by Jeff Patton   
Saturday, 11 July 2009 19:03

Do you frequently use cutout maps for things like leaves on your foliage objects?  Have you noticed that the Final Gather calculation can be quite slow when you have a lot of objects that use cutout maps?  If so, then you may find this tip useful.

Let's say you've downloaded or purchased some foliage meshes, like these Xfrog freebies from the Autodesk Seek site.  These meshes use cutout/opacity maps for the leaves.  When you use these with 3ds Max & mental ray and calculate your final gather solution it can become quite slow as it runs into these cutout type materials.

Example (click to enlarge):

For this scene I first converted the materials from standard materials (Scanline renderer) over to A&D materials. I then made a simple ground plane below the tree & enabled FG using 2 bounces on the "medium" preset.  Render time as you can see on the enlarged image was four minutes and sixteen seconds.  Most of that time was spent calculating the final gather.

However, if I simply disable the opacity/cutout map on the leaf material the render time (including FG calculation) dropped to one minute, thirty eight seconds.  Here's that render (click to enlarge):

You'll notice that I changed the diffuse color as well for this render..why?  This particular diffuse map used black for the area where the cutout happened.  So if I calculated the FG on that, I wouldn't get much bounced light in the foliage at all.  So I disabled the diffuse map & instead used a solid color that was similar to the overall color of the diffuse map and saved my FG calculation using this solid color.

Click to enlarge:

Afterwards, I froze the FG calculation and re-enabled the original diffuse map & cutout map and rendered the following image (click to enlarge) in one minute, fifty two seconds.

IMO it looks better than the original image as there's more bounced light in the foliage area, and most importantly it rendered much faster than the original setup.

Some may ask, why not use the local FG controls in the objects/properties settings? Or even use a raytype switcher to do this?  The answer is speed & results.  If I used the "Return Black" or "Pass through" modes in the FG settings (see image below) it wouldn't have the same bounced light as using a solid color.  That would make the tree much darker.

As for using a raytype switcher instead...well, if I have to modify the materials it just seems quicker to enable/disable the cutout/diffuse maps rather than having to load/enable/disable/tune a raytype switcher for this.

So give this a try and hopefully you can shave some time off your renders with this method.  Who knows, maybe someone will come along and even write a script to quickly do this process. :)

Trackback(0)
Comments (22)Add comments
Mariano wrote on July 12, 2009
 
Title: ...
Great tip Jeff ,
thanks

report abuse
vote down
vote up

Votes: -2
Paulo Barrelas wrote on July 12, 2009
 
Title: ...
It makes sense! Really good tip Jeff!
Thanks
report abuse
vote down
vote up

Votes: +0
Gurmukh Panesar wrote on July 12, 2009
 
Title: Nice trick
its a good idea..would it help where i had thousands of planes with the MetaSl grass material??..
report abuse
vote down
vote up
website
Votes: -1
Jeff Patton wrote on July 12, 2009
 
Title: ...
I haven't personally tried it with any MetaSL materials, but I would think you'd see a similar speed increase since it's more so a tweak for final gather than material related.

Again though, I haven't personally tested this with any MetaSL materials so I can't give a definitive yes/no answer.
report abuse
vote down
vote up

Votes: +1
AdamS wrote on July 14, 2009
 
Title: ...
I'm not sure this is really a better technique in terms of work flow. The first method took 4:16 in one step. The second method took 1:38 + setup + second render of 1:52 for a total of 3:30 with setup time in between.

The other negative I can see in the second method is that if there are objects behind the tree that are visible in a render with cutout enabled will not receive proper FG during the second render with the FG map that was frozen when cutout was not enabled.

From a production standpoint, the slight increase in total render time is not worth the sacrifice to work flow ease or image quality resulting from an incomplete FG solution.

I work with XFROG in Mental Ray from time to time and find the following method does essentially the same as yours, Jeff, but has a lighter work flow implementation: http://www.vizdepot.com/forums...#post74726
report abuse
vote down
vote up

Votes: +2
Russell L Thomas wrote on July 14, 2009
 
Title: Render Times
Work flow wise, I think comparing the time savings for one tree to straight rendering and saying you only save a minute may not reflect real world applications where you may have a lot of trees in the scene where tweaking one material and saving the FG could save a lot of time.

Thanks Jeff, I actually use the xFrog trees a lot in multiple render engines.
report abuse
vote down
vote up

Votes: +0
Jeff Patton wrote on July 14, 2009
 
Title: ...
Thanks for sharing your thoughts. Indeed this method may not be optimal for all scenarios or people. That being said I don't agree that there's additional setup time with what I've described here. I've basically unchecked two boxes & assigned a color. That should only take someone a few seconds to do.

However, if someone doesn't normally compute & save their .fgm file prior to rendering the final image...then yes, that will add some extra time to their process that they aren't normally accustomed to.

You are correct in stating the solid leaves will block some of the indirect illumination. This may or may not be noticeable though, it just depends on the scene. For example, f you're rendering a building that's under a lot of large trees, or a character that's under trees...this method probably won't be optimal for those type situations.

However, if you're trees are smaller or free standing it probably won't matter since skylight is not directional. It would still block some of the bounced direct light, but not much of that makes it through trees anyway so it probably wouldn't be a noticeable difference.

Also FWIW, you shouldn't combine the 1:38 + 1:52 render times. A person would calculate (no render) & save their .FGM then render. The 1:38 time I posted here includes a render + calculation time just so I could have an image here in my blog to assist in explaining the process.

The actual time would be the .FGM calculation time + final render time which would be 48 seconds plus the 1:52 final render for a total of 2:40 which is much better than the original 4:16.

Bottom line, this tip I've shared here is merely one method in a sea of possible methods. I posted it so people could explore this method and see if it helps save them some render time. This as with all the tips I've shared here won't be the perfect solution for all people or scenes. Perhaps I need to start adding this info as a disclaimer to all my posts.
report abuse
vote down
vote up
website
Votes: +1
Hamilton Junior wrote on August 01, 2009
 
Title: ...
Cool tip! I found it really useful also when using displacement maps.
Thank you!
report abuse
vote down
vote up

Votes: +0
Davius wrote on August 25, 2009
 
Title: ...
I don't believe it's needed to add disclaimers such as you said to tutorials/tips as it's implicit on all 3D projects that diferent situations require diferent solutions. Disclaimers should only be used on potentially dangerous workflows (such as rendering all those leaves with tranlucency, SSS and some Krakatoa fire on top).

For me, these tips are mind opening. Thanks a bunch Jeff!
report abuse
vote down
vote up

Votes: +1
patrick anderson wrote on August 26, 2009
 
Title: ...
great tip mate.....saving me a bunch of time of fg calcs.
report abuse
vote down
vote up

Votes: +0
Alexandre Tessier wrote on September 17, 2009
 
Title: ...
Great tip! It will be pretty useful for animations. I usually calculate the FG map for the whole animation, then render.

So, I guess a good workflow would be, at the final rendering stage, to duplicate the scene and modify the shaders of all the leaves and calculate the .fgm from this scene. And render from the original one, linking to the pre-calculated FG map... Your boss will be pretty happy with the speed gain! :-)
report abuse
vote down
vote up

Votes: +0
alan wrote on October 09, 2009
 
Title: ...
great tips thanks.
Bt if i use for foliage some traslucency value?? and maybe some map?
It can work anyway?

thanks a lot
report abuse
vote down
vote up

Votes: +0
Hildevar Martins wrote on October 18, 2009
 
Title: ...
Great Jeff.. I love you Man.... you are my master
report abuse
vote down
vote up

Votes: +0
Michiel Quist wrote on November 05, 2009
 
Title: another way...
I've comped a quick screengrab together to show that there is another way of speeding up the process, without having to do special setups or changing materials. I must admit its not as big of a speed increase, but its something. Here is the screengrab: http://www.3idee.nl/sf/trees_faster.jpg
report abuse
vote down
vote up
website
Votes: +0
Russell L Thomas wrote on November 05, 2009
 
Title: Thanks
Thanks for sharing your findings and technique.
report abuse
vote down
vote up

Votes: +0
Rodrigo wrote on March 25, 2010
 
Title: ...
As long as I am a newbie, I tried with no success to copy the parameters, would it be possible to post the example file so i can compare?. how can I translate the standard material to A&D?..is there an example in this blog?
thanks
rodrigo
report abuse
vote down
vote up

Votes: +0
Ronnie Olsthoorn wrote on March 30, 2010
 
Title: enable GI
I ran into very long rendertimes too with FG, when using cutout maps for foliage. Then I enabled GI and my rendertimes went down dramatically. From several hours to 15 minutes for a medium-res render of a forest. It seems FG on its own has serious trouble with cutout maps, with together with GI it was no problem at all. Might be an alternative solution?
report abuse
vote down
vote up
website
Votes: +0
Russell L Thomas wrote on March 31, 2010
 
Title: Thanks!
Thanks for sharing your experience.
report abuse
vote down
vote up

Votes: +0
Jeff Patton wrote on March 31, 2010
 
Title: ...
Good tip on using photons to speed up the foliage renders too. The slow down does seem isolated to how FG traces rays from objects, through the cutout maps, back to the camera. I imagine that GI/photons would indeed provide a quicker render through cutout maps than FG alone.

Thinking along those lines I wonder if Importons/IP may also be quicker with cutout/opacity maps than FG...
report abuse
vote down
vote up

Votes: +0
Russell L Thomas wrote on March 31, 2010
 
Title: Ut Ohhhh!
Ut Ohhhh! You got him to thinking! ;)
report abuse
vote down
vote up

Votes: +0
Arno wrote on October 22, 2010
 
Title: Love the grass
Grass is always a discussion. But i love the grass lawn. Like you said in your post displacement grass; you usualy don''t need displacement.
Can you add the material to MRmaterials or explaine? If it is the displacement tutorial, the link http://jeffpatton.net/MR_Grass_Displacement.htm
doesn't work anymore.
report abuse
vote down
vote up

Votes: +0
Pthalo Dezin wrote on September 15, 2011
 
Title: ...
Thank you. Such a great tip. As Xfrog releases the new generation of their models with higher polycounts and heavy reliance on the opacity map, this is going to speed my work up tremendously.
report abuse
vote down
vote up

Votes: +0

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy