Forests in maya mental ray.


#621

@InfernalDarkness: Have you found the SpreadObjects script to be kind of slow? I’ve been trying to use that one and it takes quite a while to calculate and when it’s finally done my view port is really, really slow responding. Does this sound familiar or am I doing something kind of odd? Also, I couldn’t find a way to select only a certain area of the ground plane. It wanted to put the grass across the entire ground plane even if I only wanted a certain section. Did you find a way to accomplish a task like that with that script?

And the Array tool is really cool, but after sitting through the tutorial vid and playing with it for a minute I couldn’t figure out anyway to get the instances to stick to a ground object. It doesn’t seem like that tool is really meant to handle something like scattering grass across a ground object with hills and stuff. Or did I just miss something?

Thanks!

-Justin


#622

How are you guys going about compositing your images?

I have a layer for all my geometry and another for the grass. My building layer is just that with no ground or background. My grass lawn layer has its materials on it with a surface shader assigned to the building so it doesn’t show up when composited. Then when I go to composite them together everything looks fine except the edges of where the grass meets the geometry. It has a shift in color which is lighter /brighter then the rest of the image. I wish I was at my pc right now so I can post an example to hopefully get my point across to show what I’m talking about. If no one knows what I’m talking about, I’m gunna post an image later when I get home.


#623

Sure sounds like a multiply issue but I thought we usually end up with a dark line instead.

Anyway, are you using GI with sky? Is your default grass image rendered with a visible colored background? If so…then you’ve got to make that invisible as it is probably from that.

Also just double check on your surface shader settings. maybe the mask is all the way the other side?

Another thing, check your camera gamma settings. maybe its a 2.2 gamma thing while u attempted linear workflow but forgot.

I am sorry, I am guessing here but I need a pic and I too am not in the office. I sure hope i helped some.

ON another note -
Was there a mention on how to randomly saturate textures to leaves so we can get variations? I am using Vray though I know this is MR but it should be the same i think, and working with files by using proxies which i then instance across the plain


#624

OK, yea I did something wrong with my passes and blending modes in Toxik. Although, now have ran into another problem that I just cant seem to figure out. I believe its a shader problem or something Im not setting up correctly and hopefully can solve. In this attached pic, Im trying to remove the white-part (building) from the image. So pretty much transparent, but I still need to have those gaps between the building.


#625

Hey Guys,
Like many, I have been following this thread for a while. I never actually tried to make plants and just yesterday I decided to finally give it a try.
I tried the grass/cube/sphere tests that some of you have been putting up.
All of the ‘post’ was done through shaders…yes, shame on me, but I was watching tv so didn’t bother waiting. Honestly I would have never been able to get this far without the huge contributions from everyone. Hope I can push my grass even further.





#626

Try using the “Use Background” shader and turn your specular, reflectivity and reflection limit to full black, 0 & 0 respectively. That should do the trick. Please be sure your background is black also else your going to face the same old issue u did previously.


#627

Kinematics-You da man! Worked excellent. Thats funny because I did try to using the “use background” before, but never changed the Matte Opacity to 0 and forgot to change the background environment to black.

Thank you very much for helping! :bowdown:


#628

Hi. A question to people who have dealed with Paint FX trees… :scream:
How can I force leaves to face one direction? Meaning have normals in one direction. I know about “leaf face sun” attribute but by enabling it some leaves still twisted upside down. Thanks.


#629

How can I force leaves to face one direction? Meaning have normals in one direction. I know about “leaf face sun” attribute but by enabling it some leaves still twisted upside down. Thanks.

You cannot. This is why many of us opt to use Onyx and/or Tastao_Wayne’s branch script. If you want realistic trees, you’ll need to use another tool.

That said, perhaps a script can be written to flip the normals for all those aberrent leaf planes.


#630

Ok but well-known Marlas got it working correctly? Or he must be didn’t use two-sided shader for leaf…


#631

I’m trying to follow this thread but I am still confused as to how you are all getting these amazing results. I am in the process of trying to create some realistic grass and think I understand how you are doing the instancing of the grass object using the spPaint script. My question begins with making the patch of grass to actually instance.

  1. Are you creating a patch of paint effects grass and getting the general shape and color by test rendering using maya software render, then converting to poly to instance around?

  2. After converting to poly are you then adding a new mia material and using images or whatever to texture the grass based off of its uv layout? Does this require you to reconstruct the uv layout for each blade of grass?

  3. Once you have everything textured the way you want it, you then instance the grass around?

I’m not sure if I’m on the right track or not. I know it is probably a bit much to ask, but it would be really helpful to see a step by step tutorial on how you guys have been achieving these results. I’m just having a hard time piece-milling this all together over 40 pages of replies.

Thanks for any help.


#632

To make grass:

  1. Paint a small, roundish patch of grass. Squarish patches mean you may see “edges” and it won’t help the illusion in close-ups and such.

  2. Convert to Polys. You can keep the connection to the PFX stroke for now.

  3. Apply your grass shader to the Poly Geometry. For me, this is a Blinn with a MR override and a mia_material_x using mostly the settings we’ve gone over in this thread. Translucency as well. In my shading group, this mia_material is connected to the material and shadow slots, and also the photon slot if you’re using GI (which you shouldn’t be for exterior scenes). You could use a cutout opacity on your grass, but it depends. If you tweak your initial PFX enough you won’t have to, but then again a more complex initial PFX setting means more polys. Use a cutout opacity if you need lower polys but more detail. UV’s are not an issue with most of the grasses I’ve played with, but of course you’ll want to make sure they work with your opacity map, if that’s what you’ll be using.

  4. Test render in mental ray to be sure your grass looks “right”. I use a small, self-made test scene for all my plants first, so I can compare them to each other as well for consistency. There is no need to use Maya Software anywhere in this process.

  5. Once you’re happy with your grass, delete its history (breaks connection to PFX stroke), or duplicate it and then delete the history if you prefer a non-destructive way to tweak your grass later.

  6. To replicate your grass around, you can either use Maya’s instancing (I do) or the mip_binary_proxy method for mental ray directly. The benefit to using instancing is that you can then see and tweak all your instances directly in Maya. You’ll want to set the instances to their own Display Layer with a Bounding Box display override once the polys get really heavy, so usually I do this first with my source object to save time/energy later.

  7. To place your grass objects, you can use Maya’s paint geometry, the spPaint3D script, or any other scattering script or plugin which supports duplicating as instances. You could even use a particle instancer if necessary. The key is to get your grass to have slightly different sizes of course, but mostly to get a nice random rotation on that Y axis (normal “up”).

  8. Once your instances are placed, make sure your primary renderer in mental ray is set to “Raytracing”, and that your optimization method is “BSP2”. Shadows should be set to “Segments”.

8b. If your instances are not rendering, turn on Final Gather if it’s not already in use. I’ve had issues with instancing not working without FG.

  1. Happy grassing!

Hope this helps a bit!


#633

There is a bug with the faceSun attribute where the normals can be incorrectly flipped. (I’ve just submitted it as bug 370235) It doesn’t matter for normal paint effects rendering or pfx to poly when there is a single shader, but for two sided shading it is a problem. Here is a workaround that might help:

After converting pfx to poly view from a top camera (for sun direction of 0 1 0). In custom poly display options enable and apply backface culling and marquee select the leaf faces, then do reverse normals. Now turn off backface culling, select all normals and do another reverse.

Note that leaf face sun will only modify the leave “twirl” and not affect the angle/elevation it emits from the branch.

Duncan


#634

Hey guys. Ive read this thread two times but maybe ive missed the part which is causing headache.
I dont understand how I should manage the shading. So lets say I have a tree geometry and a leaf geomtery. Would I want to create one proxy shape for a combined tree/leaf or would I want to create proxy geometry for each highres geometry?
If I would create seperate lowpoly geo for each mesh, how could I duplicate them without having the problem that the two different lowpoly meshes are on different positions when I “paint” them onto a groundplane?
If I have only one Lowpolymesh for a combined tree, how would I apply a shader that seperates the treeshader and the leafshader?
I dont get this right now. Would be cool if someone could give me a hint on this.
Im using spPainttool for duplicating my lowpoly mesh.
Thx in advance!


#635

The best way I found to do that is use different UV spaces to separate trunks and leaves with the help of the mental ray mix node mixing trunk shader and leaves shader into one “multishader”…


#636

If I have only one Lowpolymesh for a combined tree, how would I apply a shader that seperates the treeshader and the leafshader?

The method I use is to set up each plant in it’s own scene for asset purposes. Each complex plant has its own Trunk, Branch, Twig, Stem, and Leaf groups. Sometimes multiple of each, especially Leaves. I always use at least two different leaves per tree. Others here use nine!

I create one to three wood shaders with unique names pertinent, then the necessary amount of leaf shaders. Test render until it “looks okay”, then duplicate all the geometry and Combine that duplicate stuff, delete History. This way in my “setup scene” per plant I still have my unique original geometry.

The combined object works just fine. You can select the parts on a per-material basis or break it down using Separate, if necessary. But this is the object I export to a clean scene for my library, and for importing as an asset into my main scenes. The combined object works just fine for instancing. If you need to tweak the shaders, you can still do so. The object shades the various parts on a per-face basis, at that point. Hope this helps!

Edit: the various faces of the combined tree object retain their own UV space, so remapping the UV’s after you initially check them is unnecessary. And all the parts retain their initial materials and shader groups. You don’t need one material per part, just a wood material and a few leaf materials.


#637

Ok, just for understanding. You say you setup the tree first in a seperat file, do all the shading and stuff there. Then you combine it and import it as an asset/reference or just plain into the proxy scene?


#638

Alright…so after dealing with this half a day I made…hmm…lets call it “some progress”. Creating an asset and then importing it as a reference did not work pretty well. Same if I e.g. combine the stuff in the scene, make a proxy and then delete the original highply tree.
The problem is still the same! How to apply the shader? So I still have only one proxy geometry and right now 2 leafstyles and the bark/branches mesh. So that would make 3 shaders. would these 3 shaders need to be combined to one single shader in order to work appropriately on the single-proxymesh?

Next thing is the multipliernode. I have no clue how to use that. Ive read this and the mia_material for realistic leafs - thread up and down today and all I can see is just letters! oO … plus i saw that the translucency-map is hooked into the multiplier node and that goes into the translucency color thingy.
But do i input the map in input1 or input2? Where to set the 4times-multiply?? God so many questions…
I read and read and think “oh yeah thats logical” and after reading more I completely get brainf…ed! :stuck_out_tongue:
Anyway…Its no problem to generate and render my proxies but the shading is my problem. As soon as I delete my original, i loose the shading.

Would appretiate some help! :wink:

Here are some results from 2day.

700 proxies each with around 900k polys. rendered in 1080p in one hour. Ram usage was at 5gig (of32)
My Shader right now (for the leafs) connects all in one single mia_material_x_passes. So up and bottom leafs are comming together via a mib_doublesided into the final mia_mat…which is then applied to the leafs geometry! Is this wrong? I dont know!

Help pls! I have headache!


#639

Thanks for the reply infernaldarkness! Would it be possible to see a shading network for your grass shader and a snapshot of the uv layout for the grass with texture applied? Are you also using an actual grass texture from an image or do you use more of a procedural texture and fractal or something similar?

Thanks again!


#640

Ok, just for understanding. You say you setup the tree first in a seperat file, do all the shading and stuff there. Then you combine it and import it as an asset/reference or just plain into the proxy scene?

I don’t use assets, proxies, or references currently. I just import the .mb file itself once I’m finished setting up my initial tree object.

Thanks for the reply infernaldarkness! Would it be possible to see a shading network for your grass shader and a snapshot of the uv layout for the grass with texture applied? Are you also using an actual grass texture from an image or do you use more of a procedural texture and fractal or something similar?

There’s really no shading network for my grasses. Just a mia_material_x with a file texture mapped in for color and a little bump/translucency. UV’s are not an issue if you’re using PFX to make your grass.

Latest example, my “test scene”: