mia_material for realistic leaves


#1

After seeing Alessandro amazing work:
http://forums.cgsociety.org/showthread.php?f=132&t=754315&page=1&pp=15

i wanted to achieve a similar effect.Now i never got a response whether he used translucency or not. My guess is yes, so i want to know whats the correct steps:

1-thin walled checked
2-i am using a 0.1 value for trancparency because translucency requires some level of transparency. is that value enough? too high, too low? because when i put it to 1, i get very strong translucency but the material gets a bit dark.
3-translucency weight:1 because the leaves are not transparent.
4-translucency color, should i choose a flat color? or should i plug the same texture as my diffuse slot


#2

Translucency is going to get you half of the way there, but you’re likely going to want to do some subsurface scattering and add an extra layer or two of specular (a wide rough one, and a tight one, much like skin).

The preferred workflow for skin & other organics these days is to pipe the output of a subsurface shader as additional color atop an mia_material. You can paint veining in your leaves in the subsurface layer, and turn off the specular and diffuse in your sub layer as well (unless they look good, then keep 'em in :slight_smile:

Hope this helps,

–T


#3

if i plug a sss shader to the aditional color of the mia_material then it wouldn’t be physically correct because the mia_material is based on this formula : diffue+reflection+refraction=1. Now if you add an aditional color, it will be added to the overall value and it would be bigger than 1.
Besides, what really happens in the sahder when you plug an sss to the aditional color slot?


#4

That’s absolutely correct. The color of your diffuse + specular reflection can’t exceed 1 for it to be energy conserving. You generally dial down your diffuse level to compensate for the piped through SSS, but it won’t be “physically accurate”.

That said, there’s a distinction to be made between “physical accuracy” and “it looks awesome”. Most folks using fast_skin are using the diffuse in mia_mat these days and using the workflow that I just described.

Translucence is cheated SSS + transparency by the way, very much not physically accurate.

In a nutshell, this:

http://forums.cgsociety.org/showthread.php?f=121&t=629792

(that’s the “skinplus” workflow in 3DSmax – SSS into additional color on an mia)

Granted it’s skin. But look nice and closely at the greens and how they fade into shadow…

–T


#5

so you plug your sss shader to your mia_material aditional color slot, why not diretcly the diffuse?

if i get it right: - reflections/specular and part of the diffuse are driven by the mia_material
- part of the diffuse are also driven by he mia_material
- what drives the transparency then?

regarding the hulk thread, wich page talk about the shading network details , didn’t find it.


#6

Generally, instead of using the diffuse component on (say) a fast_skin, you use the diffuse on the mia_material at .3-.5ish contribution instead. You’re turning off the diffuse on the SSS mat entirely so that stuff doesn’t get blown out, and it maintains some semblance of physical accuracy (ie not reflecting more light than hits it).

Here’s a post by Zap (who programmed fast skin and the arch mats) talking about the workflow in 3ds Max… pretty much the same in Maya, except the connections are easier and you don’t need a specialized .mi to do it… maya details are down in the commments section.

Just apply the fast_skin to an object first, so that the lightmaps etc etc are created, and paste them from the fast skin shading group to the mia_mat shading group.

http://mentalraytips.blogspot.com/2008/04/beauty-isnt-only-skin-deep-combining.html

And it looks pretty darned awesome. Used this workflow for an aloe plant on a gig not too long ago and it looked phenomenal… can’t find examples at the moment, but I’ll post em if I find them.

–T


#7

Also worth mentioning that you use the diffuse to keep from having to check “use indirect illumination” on your fast skin…

There’s been a bug in Maya 2009 and 2010 that SSS lightmaps take an eternity to calculate if final gather is turned on. Of course AD talked it up as a feature… something like “due to more accurate calculations, SSS maps with final gather now take a billion times longer to generate”.

Scenes rendering 10x as slow from Maya 2008 to 2009 qualify as a bug to me.

But I digress…

Anyhow, I generally cheat my mia_diffuse a little higher than I should to compensate for the lack of FG contribution in my subsurface, because render times including indirect in my SSS are intolerable.

–T


#8

I usually use a mia_material_x with at least 0.2/0.25 transparency, a 0.95 translucency weight with a solid clear green color instead of the same texture I use for diffuse, otherwise the effect I get is too dark, or you should use a clearer version of the diffuse texture.
Never tested any of the SSS shaders for leaves but in most cases I think the mia should be faster and easier: it depends on your needs.


#9

for mid range/ background leaves, i would definitivly use the mia_material with similar values.

tharrell, thanks alot for the info, your method is specially useful for hero objects.

  • if i got it right you copy and paste the lightmaps of a misss_fast_skin_maya shader to the mia_material SG.

  • drag the sss shader to the additional color of the mia_material

  • apply the mia_material to the object.
    -turn off diifuse color and weight of the sss shader (what about the overall color slot?)

  • play around with the “Subsurface Scaterring layer” values

  • But mastezap mentioned that you also should turn off “unscattered diffuse” in the sss sahder. I can’t find that section

-did the AD fixed the bug of lightmaps rendering superslow with FG in Maya 2010?


#10

Yep, you’ve got it right.

The diffuse that you turn off is the ambient color (leave black) overall color (leave white) and the diffuse color (leave blueish, but turn the weight to 0). It’s the block at the top of the node.

The overall color is a multiplier on the entire network, so if you like the look but it’s too bright, you can scale it down with that.

Yeah, definitely not suggesting that you put SSS on a billion background objects that you can cheat, but for hero stuff up close to camera it looks really nice.

And no, the bug isn’t fixed in 2010… it’s a feature now!

–T


#11

…but if it’s a personal (no NDA) project, would you mind sharing your results Roy? As you make progress, I mean. No rush. I’m working on a personal “landscape” project in a similar vein as our hero Alessandro, and having a nightmare of a time with my leaves…

But I have been significantly impressed with MR under Win7 x64 / Maya 2009 x64. Pushing many millions of polys more (at rendertime) than I ever was able to do a year ago. I hope you’re experiencing the same luxuries, because when I originally saw Alessandro’s work, it truly seemed impossible to do with Maya. Now, it’s still impossible to match, but hopefully one can get close to that level of detail and realism!

Anyway, this thread rocks and thanks to all for posting helpful ideas and techniques.


#12

Of course!
i did some tests with leaves some time ago and it’s generally easy to get descent results with good texturing.
My main focus right now is to model/shade grass like Alessandro’s impressing grass, it’s much harder than leaves.
Anyways, i will post renders/files regarding the progress for leaves and grass, so that we could join forces.

btw how many triangles are you able to handle in your viewport shaded, textured?


#13

Well when you say “handle” it could mean “and still tumble / zoom in this lifetime”, or it could just mean total display handling. So far I’ve hit no limit on how many polys it will display, and my scene may have 10 million or so. But I have to use a great many display layers (PFX_plants_far, PFX_plants_near_right, Poly_trees_far, and on like that) to make the scene functional for zooming and stuff. I imagine the poly-limit / frame-rate factor is similar to gaming performance on this card, which isn’t horrible, but if I were pushing the same 10 million polys (faces) in Unreal 3 or Protoype for example it would probably bog down just as much.

But my homestation only has a Geforce 7950GT in it, with 512MB of RAM. Not a “recent” GPU by any means. I’ll post a screenshot at some point but I don’t intend to hijack your thread, my friend! It’s good to know there are others working on similar things, though. Thanks for sharing and for all the tips.


#14

royterr, this has been a subject on my mind for a long time and something I play around with quite a bit. I would like to know the ideal way to set up leaf and grass materials as well.

I asked allesandro over on evermotion about his mia_material settings for leaves but he never responded. IIRC correctly in a post he did mention he used all mia_material, and I don’t remember him mentioning misss. So I assume his plants have no misss shader in the mix. Of course, I could be completely wrong, I have no idea. But from looking at his renders, they do not look like they have misss shaders on them to me. I think it might be very proper adjustment of mia_material settings and colors, and then very well done color correction.

The thin-walled translucency function on the mia_material was designed for exactly this purpose and I do think it offers all that is required for grass blades and thin walled leaves. I mean, the misss shaders don’t even calculate properly on thin-walled surfaces do they? I thought they were intended for sealed meshes with volume.

I’ll run some tests myself and post them.


#15

my intuition also tells me it’s the mia_material that has been used in the scene.
it’s going te be a tough one but nothing is inpossible.

The first thing i noticed is that the ground beneath the grass is textured with some leaves/soil texture and helps really alot in giving the impression of dense grass covering all the surface.

As for the geometry, i think he started with a PF grass perset and tweaked it alot because i have tried them all and nothing ressembles his grass.

i will post mt tests soon.


#16

One thing to note. Reflection, refracton and shadow raytracing depth have absolutely no effect whatsoever on the nature of how mia_material translucency propagates lighting through the leaves. You can leave all of them at 1 with no change in lighting.

Now, to be physically correct you want translucency weight at 1, since no leaf or grassblade is semi-transparent, they are fully translucent. So for all purposes of leaves and grassblades I set tranclucency weight to 1 and control the level of translucency purely with the transparency slider.

Transparency 1.0 (the darkness comes from me having the FG filter set to 2)

Transparency .8

Transparency .6

Transparency .4

Transparency .2

Transparency 0

Now one thing about that series of images above is, the translucency color is brighter than the leaf color. I think that in some ways that makes it look more realistic because looking behind the leaves in the sun they appear brighter, but is that physically correct?

Here is a series of images where the only thing I’m adjusting is the brightness of the translucency color, which is a slightly yellow solid color. Transparency is set to .4 in all images.

Translucency Color 1

TransclucenyColor .6

TranslucencyColor .3

TranslucencyColor .1

So I think thin-walled translucency by itself is very capable of propagating a SSS effect through leaves by itself. The misss shaders I do not think are necessary. Just properly adjusted mia_material.

I think physically accurate would be with the diffuse color and translucency color about the same level of brightness. Then make the translucency color slightly tinted yellow, and maybe increased .1 brightness just for a little more behind the leaf shine.


#17

I think physically accurate would be with the diffuse color and translucency color about the same level of brightness. Then make the translucency color slightly tinted yellow, and maybe increased .1 brightness just for a little more behind the leaf shine.

and heres some renders with those settings



and some allesandro style-esque color correcting

only not as good

here is the scene file if anyone wants to run some more tests
http://www.4shared.com/file/130083720/58ad2398/treeTest.html


#18

Whats the “additional color of the mia_material”? In SG; Custom shaders>material shader? or ? Confused on that part.

And could the light maps also be connected to the light map shader attribute instead of being copied and then connected?


#19

the aditional color is simply a slot in the advanced section of the mia_material.

i dont know how lightmaps work and if 2 materials can share the same light map.


#20

I must be blind… is it a feature in 2010 only? I’m in 2009.

I’m checking out the shader network rygoody put up and he has oakLeaf.tif hooked into the cutout opacity? Not same thing?