View Full Version : grass animation

01 January 2011, 12:53 AM
i am working on a film for a school project and am looking for some help creating the grass that we need for our film and getting it to react dynamically with characters and wind. what we have so far is a polygonal landmass with maya fur grass attached to the surface. we have created character collision rigs from collide spheres and cubes and are going to implement those react to effect a hair system in which the collisions from the character rigs will drive the maya fur grass. So here are the main points.

1) For fairly large area maya fur works pretty well to create the grass we need however closeup shots of which there are only a few tend to not look as good as i would like them. I know grass can be created with paint fx and even just modeling it as well. Does anyone have a good recommendation of how to go about getting the grass to look good without adding an intense amount of render time.

2) We are having trouble getting the collision rigs to effect the hair system in the way we would like it to. We want the grass to move as the characters walk through it as well as bend to the ground when the characters walk over it. The film takes place in a swamp so this is a pretty big technical aspect that needs to be worked out. If anyone has any addition information or suggestions on ways to improve what we are looking for a would really appreciate the help.

Thank you.

01 January 2011, 09:38 AM
can we see some samples...

not sure about collisions but i did alot of RnD in paint effects and you can get good results (but not photorealistic renders) here is some results:

01 January 2011, 02:02 PM
those look really good. not to worried about getting photorealistic results as our film doesnt have a photorealistic style, but rather more of a painterly/abstract style. Also the environment is a swamp so the grass isnt really supposed to be perfect like on a golf course.

how long did they take to render?

I am not too familiar with the paint fx tool in maya. any chance you could describe a little more in detail how you were able to achieve the look of your grass in those renders.

here are a couple of samples from our environment rendered at preview quality in mental ray. keep in mind that the bald spots are areas where there are trees and have been created by using a baldness map texture attached to the baldness attribute.

here are some samples: ( ( (

01 January 2011, 07:45 PM
paintFX are wonderful for what you want.

take a look here, this was just a 10min setup scene, basically I wanted to know how fast our renderfarm renders a parti_volume / animated trees&grass scene.

if you convert them to polygones with history on and put a mia_material shader network (twosided, translucency) over the grass you can make the blades look VERY realistic.

01 January 2011, 10:33 PM

Very nice render mate :)

01 January 2011, 05:22 AM
Hi Markovits, your render result is amazing! A tutor or some tips would be very appreciated!

01 January 2011, 08:06 AM
haha... there's nothing special on my scene.

there are instanced paintFX trees with a MIA material shader for the leaves. I used opacity, specular, bump, diffuse and translucency(!) maps -> watch the Forest thread ( for tips & tricks

then I created a grass patch with paintFX (I think the windy wide preset, something like that) converted them also to polygones and instanced them over the field.
for the grass I used two MIA materials, both connected to a mib_twosided which is connected to the material shader slot of one of the MIA shading groups. both MIAs also use opacity, spec, bump, diffuse and translucency maps but different ones which simulate the back side of the grass blade.

for the animation I just activated the grass & tree wind turbulence in the paintFX tab under Tubes > Behaviour > Turbulence I think.


01 January 2011, 06:36 PM
alright so im working with paint fx now and getting myself familiar with the tools. I am having another problem now. Basically when I paint the grass in the scene and there are objects like plants I get an ugly effect like this: (

Does anyone know how to get the grass to not overlap the geometry?

01 January 2011, 10:38 PM
how long did they take to render?

I am not too familiar with the paint fx tool in maya. any chance you could describe a little more in detail how you were able to achieve the look of your grass in those renders.

they didn't take too long to render, it all depends on your mia material reflection samples.
start with a big brush and high density values make a straight line or a big circle to get a covered surface of 10meteres*10meters, tune your blades (your pfx branches) so they look like grass. make 2 big patches for more control, one clean straight and another more chaotic (you give it a high random value in the forces section).
good luck!

01 January 2011, 01:34 PM
Thanks Markovits for your tips, I'll have a try. I used to render grass use Shave but never achieve such a realistic look. After seeing your render result I can't wait to try with PaintEffects, thanks! :beer:

02 February 2011, 06:24 AM
Still haven't found a solution to the above issue I described. Just reposting in hopes someone who knows how to fix it see this. Thanks.

02 February 2011, 10:57 AM
Still haven't found a solution to the above issue I described. Just reposting in hopes someone who knows how to fix it see this. Thanks.

PFX doesnt "see" the plant.
So just duplicate your ground,cut out the section where the base of the plant stands and paint on that surface then hide it.

02 February 2011, 06:51 PM
royterr i appreciate your suggestion however, I don't believe that will solve the problem. The problem is really when there are objects that overlap the grass as opposed to objects being directly on top of the grass. I tried to make it clear in the following two picture. There must be a way to have geometry override paint fx or something like that. I still need help with this issue so if anyone has any additional suggestions please shoot them my way. Thanks again. ( (

02 February 2011, 07:03 PM
royterr i appreciate your suggestion however, I don't believe that will solve the problem. The problem is really when there are objects that overlap the grass as opposed to objects being directly on top of the grass. I tried to make it clear in the following two picture. There must be a way to have geometry override paint fx or something like that. I still need help with this issue so if anyone has any additional suggestions please shoot them my way. Thanks again. ( (

Nowadays nobody uses paint effects in their primitive state (rendered as brushes) so always convert to polygons once you are satisfied (you are accoutering a view port Zfight issue it should render fine).

02 February 2011, 10:05 PM
First off I'd like to thank you all for your help so far. I am learning a lot about paint effects and am getting some really nice results. I am still having a problem though when converting to poly's. Is there a way to convert to poly's where it still keeps the look of the grass before it was converted (paint effects) the same? The following images shows a patch of grass that was converted and the undesirable outcome that I am talking about. ( (

02 February 2011, 12:27 AM
Pfx to poly tries to construct a shading network that captures the look of the brush. But it does not work well for all brushes. In some cases you might need to output color per vertex and use a color per vert texture in mental ray to get a good match.

However I would recommend just assigning a shader from scratch and setting up good attributes. The pfx to poly tends to result in too much translucence for some renders, relying on shadowing to get the detail. In some cases the grass brushes have fake shadowing based on distance to the ground. Just ramping the color to darker near the base with a texture can do much the same effect.


02 February 2011, 12:57 AM
thanks so much ill give that a try

02 February 2011, 03:11 AM
does anyone know a good way to incorporate foot stomps from characters into the grass? i have been experimenting with the line modifier, but I was wondering if there was a better way.

02 February 2011, 09:11 PM
The line modifier method is the simplest I know of... just parent a modifier to each foot. On the modifier make the brush scale 1 and adjust the force, dropoff and shape attributes for the best effect. This is non-dynamic( i.e. one can scrub frame without simulating ). For a more accurate dynamic method you could potentially create maya hair curves to control the grass, either colliding with the boot mesh or using a collision constraint parented to the boot. One can apply the hair output curves as control curves on the grass and use curve follow on the brush, however a better setup is to use the hair system for the grass in the first place( with pfx output on the hair system ). ( you can use pfx to poly as before) The individual dynamic hairs can control clumps that look and render just as the grass looks on the pfx brushes, although it takes a bit of tweaking to get the right look. You need to assign a pfx brush to the hair system in order to get the flatness on the tubes, although most of the other attributes you need would be on the hair system.


02 February 2011, 03:50 AM
characters walking on grass are so common in productions.
It would be really cool to have a tutorial one day.
jgreen827, could you post a play blast with Duncan's technique, i always wanted to see a clean solution for this in maya.

02 February 2011, 08:19 AM
i think im gonna stick with the linemodifier method for now as its giving me some acceptable results.

one thing i was wondering tho was is there a way to control the speed that at takes for the grass to return to its original state after it has been effected by the line modifier? what i have done so far is basically constrain a modifier to a foot and after the foot leaves the ground i key the constraint off leaving the line modifier on the ground. Then over about 30frames the forces change from their max values to a value of 0. This creates the slow return effect that I am trying to achieve.

However this method is impracticable if I wanted the grass to move as the feet pass through it because then I would have to leave a line modifier almost every frame to make up for the quick movement as opposed to a footstomp which stays in the same location on the ground.

So, is there a way to control the speed that at takes for the grass to return to its original state after it has been effected by the line modifier?

02 February 2011, 09:02 PM
so have been experimenting with baking the animation of the grass. i have been selecting the strokes and then going to edit, keys, and bake simulation for the duration of the shots. the simulation bakes and adds keys to every frame like its supposed to do. then i un-reference the characters which contain the line modifiers and it no longer looks like the effect of the line mods, the foot stomps, have been baked into the animation. this wind effect however is still there. am i missing a something when it comes to baking the effect of the line modifiers into the grass stroke animation? i need to do it so eventually the characters can be un-referenced and its just the paint fx grass in the scene and no characters.

also still wondering about if there is a way to control the speed that at takes for the grass to return to its original state after it has been effected by the line modifier?

02 February 2011, 10:48 PM
Your simulation with pfx and line modifiers is non-dynamic (one can scrub frames back and forwards and get the same effect... no need to bake). The line modifier effect on the grass is like a deformer, not a collision object. Thus the only way to have the grass come back slower is to modify the animation off the line deformer. If you need collisions to have a lasting effect AFTER the collision then you may wish to go to a fully dynamic simulation. Instead of line deformers try making the grass with Maya hair and use collisons. I've attached a file that uses maya hair for grass (one can still do everything a pfx brush does... one can assign a pfx brush to the hair system as well, if desired) One problem is that there is no notion of fatigue with Maya hair, so in order to keep the grass from rebounding one needs low stiffness and some drag on the hair. (perhaps one could create a volume bounded drag field near the ground, such that the hair would get stuck in it when it got pushed down)
... note that the attached file renders with more grass than is showed in the view( hair display quality setting)

02 February 2011, 05:19 AM
Thanks for all your suggestions I'll keep working at it

02 February 2011, 05:31 PM
so i am still messing around with ur hairsystem suggestion. the first image shows the trouble i am having in applying my pfx brush onto the hairsystem. i don't know why but the pfx ends up getting somewhat warped and looks terrible. is there a way perhaps to just create the hairsystem and apply it to my already created pfx strokes or can you only apply strokes to the hairsystem?

also the second picture shows a character collision rig that we have created with several collide spheres and cubes that have been constrained to the characters body parts. We have connected those collision objects to the hairsystem from your file, but when the character is animated through the grass there is no dynamic collision effect.

If you have any more suggestions I'll keep trying otherwise at this point I may just go back to using line modifiers as time is becoming an issue. Thanks again for all your help. ( (

02 February 2011, 08:49 PM
When you apply a pfx brush to a hair system the individual hairs become like pfx strokes(i.e. the path curve created when you paint a stroke) Thus the tubes emit from them. If tubes = OFF on the brush then one just renders the base hairs as simple strokes.

If you wish to use the tubes=ON setting of the brush, then it is still possible to have the tubes follow the hairs and emit from the hair base. Make tubePerStep = 0 on the brush and set the start tubes to the desired value. Path follow can then be used to follow the hair curve. The number of segments needs to match the number of segments per hair for it to follow exactly. Set tubeDirection to alongPath. Increase the length min/max until the tubes are the same length as the hairs. (as well one can make length flex = 1 for an exact match )

However you may be better off by using the clumping attributes on the hair system, and keeping tubes = off on the brush. Set the colors and tube shapes using the hair clumping( as was done in the example scene I sent you ). Also note that when using a hair system these attributes on the brush are driven by the hair system...
hair width->brush width
hair color ->color1

The hair system has a default internal brush(defaults to the thin line render method), so one need not assign any brush, however if one wishes to have flat tubes or use a different render method then one must assign a brush and use the flatness on the brush. One also needs to assign a brush to get effects like branches, flowers or leaves.

I'm not sure why your collision constraints are not working. Check the hypergraph connections to make sure the constraints are hooked up to the right hair system. They should be connected just as the constraint in my example was. Check that the values on the constraint node match as well.


02 February 2011, 06:59 PM
it looks like we have gotten collisions working and you are definitely right dynamics are the way to go. are biggest hurdle now is trying to match the look of the pfx hair with the look we had before with pfx without a hair system. it still annoys me that i can't just copy the brush settings and get an exact look but o well im over it.

we are using the tubes off method and are getting close to matching. one thing we haven't been having success with though is shadows. before i was using the 3d cast shadow option which now seems to not work. the 2d option does appear to add a shadow but it doesn't look good nor does it cast the shadow on the ground. As always hoping you could shed some light on this for me.

All of you advice has been immensely helpful and im just hoping that I can apply your ideas to get to the end of the road with this grass. Should we prove successful ill be sure to post some pics/videos along with an explanation so others out there can have the same success. There really isnt much on grass dynamics which is odd considering it seems like such a common occurrence.

02 February 2011, 07:36 PM
The hair system node has a cast shadows toggle under shading. If this is not enough then also enable the cast shadows toggle on the brush. As long the the light has depth map shadows enabled it should work (raytrace shadows won't work with the pfx post render, but you could convert to poly, which is usually better unless you have a lot of grass)

If you really liked your initial pfx layout and didn't want to recreate it as hair, you could create a hair system with nurbs curve output and use the curves as control curves on the pfx. This is good for some things, although the direct hair method is generally better at handling twist and the multiple curves. Once it is set up it is much more flexible than the control curve method. However if you have a setup and just want to bend a few things, then the control curves might be the easier route.


02 February 2011, 01:27 AM
there is a lot of grass and we have tried converting to poly in the past and it has caused me the same headache i am dealing with now in the fact that after the conversion the grass no longer looked the way it did when it was just paint fx.

I have been messing around for several hours now and below is how far I have gotten to matching the looking of the original paint fx grass, which can be seen on the left side of the image. I feel like I am almost there, but I am really having the biggest problem getting it to curl/bend correctly. it just doesn't look like the grass is weaving btw itself like the original pfx, but rather a bunch of independent blades of grass clumped together.

I am also having issues getting the grass to look clean an less pixelated than it does now (edit: actually from the pic here it doesnt seem as pixelated as it does in the render view on my machine, some good news at last i suppose)

The depth map shadows seem to be working however to get the effect below i had to use a resolution of a whopping 8192 and a filter size of 3 and the shadows still don't look as clean as the paint fx grass to the left.

ill keep tinkering with the clump and hair shape attributes and scales, as well as the color which is prolly the most successful area that I have tried and yet it still needs work.

if you have any suggestion from looking at the picture i have no doubt that like everything else so far is it will be greatly helpful. Also, ill be happy to post some pics of the attribute editor for the hair system if that would help as well. let me know and thanks again (

02 February 2011, 03:40 PM
so i know its been mentioned in this post already, but does anyone know how to assign a pfx brush to a newly created hairsystem , that i guess outputs curves, that controls the pfx grass? really could use some help here if its possible.

02 February 2011, 06:23 PM
does anyone know how to get the root of the grass to not be a different color. as u can see i only have one color selected for my grass and yet the root is brighter than the tip (

02 February 2011, 08:40 PM
alright so I am making some progress trying to get the hair system pfx grass implemented into the environment. I have gotten the look the way I like it and have saved my hair system and pfx brush presets from the attribute editor.

then i went in and started painting a new hair system into the environment with pfx output as can be seen here: (

then I attached a pfx brush to the hair system as seen here: (

now I have applied my presets from before to the current hair system and pfx brush, but now I am getting the following results: ( (

I also get some sort of warning that says not all of the pfx was drawn onto the hair system (but it is visible when I render so I guess its just a display settings issue). As you can see though for whatever reason now the grass shape is warped and twisted from my previous grass with the same settings applied. I am unsure as to why this is, my guess since the settings are the same it must be the length of the hair follicles from when I painted the system. The length is shorter this time. Is this likely the issue? If so whats the best way to go about fixing it?

Is there a way to adjust the length of the hair after the follicles have already been painted or do I have to go and paint new follicles of longer lengths and have those attached to the same original hair system? Just to be clear the length setting I am talking about is found under the options for paint hair follicles.

Also, under those options I noticed there is an edit follicles, trim and extend options under the drop down. Can anyone explain to me how those work. I am looking for a way to adjust grass lengths/height in specific areas without having to go back and delete follicles and then add in new ones with larger length values. Any advice would be greatly appreciated.

02 February 2011, 04:09 AM
The answer to some of your questions depends on whether or not you are using a brush with "tubes" = ON. If ON, then the color1 of the grass is determined by the color ramp on the hair. Otherwise one simply uses the color ramp on the hair to match the color ramping on the original grass.

If the pfx grass used the setting "fakeShadow" = 3dCast, then it creates a detailed shadow on the ground without raytraced or depth map shadows. However you can't use this fake shadowing with the hair, because it relies on the stroke path being along the ground. For your scene, you would need to use a very high resolution depth map to get sharp shadows on the hair( with or without converting to poly). With depth map shadows make sure the focus on the map is as tight as possible so that you don't waste resolution. If you converted to poly you could instead use raytrace shadows, which will naturally be sharp.

If you are using the tubes=ON method then your clumping problem could be due to something like path or curve attract. If using hair curves as pfx control curves then use curve follow, but not curve attract.
If tubes is off then it is likely the clump width scale on the hair system.

Note that you can paint new hairs into an existing system: hair: paintFollicles, mode = create.

You can scale the length of the hairs using hair:scaleHairTool, or with paintFollicle: mode = edit, attribute= hairScale.

02 February 2011, 03:08 PM
i am using tubes off.

as for the color this is what the ramp color on my hair system looks like. doesn't make sense to me based on these settings why the root should b different: (

as for the weird clumping and twisting i guess it is the scale I have to play with I just didnt expect to have to adjust it because the follicle height was changed.

the paint follicle edit mode was exactly what i was looking for so thank you for that advice. i actually have tried to use it before but didnt realize that the brush type had to be changed to add.

02 February 2011, 08:05 PM
Note that the color used is the hairColor multiplied by the hairColorScale ramp. The ramp maps from root to tip. The grass brush you used likely also had some depth shadow, which simply reduces the light brightness based on distance from the ground( as determined by the stroke path ). Depth shadow should be set to zero for hairsystem brushes, as the stroke becomes the dynamic hair curve instead of the ground. You can largely simulate its effect by making the root of the hair darker, although if you convert to poly and shadow from diffuse sources(global illumination) or multiple lights then it will tend to happen naturally.

You may also wish to make translucency low or zero depending on the desired rendering. If using the mesh renderType on the brush then opacity should be set to 1.0 (fully opaque).


02 February 2011, 08:10 PM
In terms of the per follicle height... the painting attempts to preserve the size of a segment defined by points per hair and hair length. It could be that your dynamic hairs have more segments than before, resulting in a finer resolution of the clump width( or other clump shape attributes ).

02 February 2011, 08:02 PM
ok so heres one more isssue to add to this crazy thread. I am doing some dynamic tests with the grass and am getting promising results but further tweaking is definitely needed. Right now when the character walks through the grass I am getting good collision except for one issue. The collision are moving to many clumps or really just to large an area of grass. Example of what should be just grass effected by one of the characters foot, but the area affected is much larger: ( ( (

This is what happens when I try an up the UV number when painting follicles figuring this would give me more accurate collision. The green follicles have a setting of 60 while the blue have 120. As you can see there is no difference. Is 60 the max number because I can go less and notice a difference but not more? Any advice on how to get the collisions more accuracte if there is no way to get the follicles denser? Thank you (

02 February 2011, 12:32 AM
The follicle density limit for painting is determined by the option variable "createHairMaxDensity", which defaults to 100 (or 100x100 hairs across a surface). This limit is mainly because the follicle paint tool gets slow when the limit is much higher... it runs a script at that grid density, which gets slow for high density even if there are no follicles. The paint tool relies on follicle naming to find a follicle at a grid index. Thus if you change the createHairMaxDensity you will not be able to properly use the paint tool on follicles you had previously created because it will change the indexing of the follicle names. (although you can still edit them as you would any other nodes, just not with the paint tool).

At any rate you could use this command to double the resolution:
optionVar -intValue createHairMaxDensity 200

03 March 2011, 04:48 PM
That command did the trick and the collisions are now looking great. The next and what I think will be the last aspect I need to figure out is getting the grass to be effected by wind. What I need to come up with are about 3-4 different wind settings that range from a calm wind to a stormy wind. Before I was able to get nice results when adjusting values in the turbulence section of the pfx brush but now since the pfx are driven by the hair system I have to find another way. There is a turbulence section in the hair system attributes but that hasn't given me any successful results. I have tried applying air and turbulence fields as well but still haven't been getting the wind effect that I am looking for.

Are one of these ways the best way to go about getting wind and maybe I just havent found the right settings yet or is there a better way to get a wind effect? What do you recommend as the best way to go about creating a wind system for the grass?

03 March 2011, 07:26 PM
Just apply a single volume axis field to all your grass and use the turbulence attributes on that (make all force outside of the turbulence zero, like away from center). Adjust the various turbulence attributes to get the best effect. Some drag on the hair will help. You might want to define some directional force on the volume axis if there is a prevailing wind direction. You could get fancy and animate the turbulence offset moving in the wind direction, which would create waves that travel with the wind.

03 March 2011, 03:13 AM
i have hair systems driving pfx grass and i also have just pfx grass in the scene. neither of which will be converted to polys. i was able to create a field that effects the hair system pfx grass, but not just the pfx grass. is it possible to create a field that is connected to the pfx grass?

03 March 2011, 07:25 PM
You can't assign a field directly to paint effects. However you can use a line modifier on the paint effects like a field. Make widthScale 1 on the modifier and set the modifier force attributes. The pfx grass will still not be dynamic, however. It will bend but not jiggle, but you could animate the line modifier to get a close enough look. If you need the dynamic behavior you could could create a hair system(output curves only), apply your force to that then use the output curves from the system as control curves on the grass pfx brush. This is not accurate for collisions and such but is sufficient if all you want to do is apply the effect of a force.

03 March 2011, 07:38 PM
i decided to just match the turbulence setting from the pfx with the wind speeds i created from the volume axis field to get a nice result.

got another question. i am going through shots and caching the hair simulations for collisions and for the wind. is there a way that if i scrub through the timeline and want to go back to frame one the grass will look like it did before i scrubbed. i guess i basically want to set a start position i think??? i have been unsuccessful with that option so far. what i am afraid of happening is if i scrub the timeline fast the grass will sometimes just fall down and look whacky and since it is necessary for me to scrub before caching the simulations i dont want the simulation to start off looking wierd on frame one as it then naturally adjusts itself back to normal. i suppose i coudd just cache the simulations something like 60frames before i need that way the grass can return to a normal position, but I thought maybe you knew another way.

03 March 2011, 07:54 PM
When you rewind to the start frame of the simulation it should go back to the start position of the hair( by default this is straight, but you can edit the start position curves if desired, or set them from a current position ). If it is not going back to the start state when you rewind, then perhaps you are not rewinding to the start frame (sometimes changing the frame rate can result in fractional values where frame 1 is not exactly 1). You could possibly change your start frame on the timeline, or the start frame on the hairSystem. If the problem is not the start frame then it might be an update problem( perhaps due to some node type not being displayed ). Sometimes creating an expression "dgdirty -a" will fix such issues.

03 March 2011, 12:22 AM
been trying to set up a render test but have been getting the following warning/error messages:

// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_main25_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_main20_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_main15_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_main10_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_edge10_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_edge05_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_hole10_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_hole05_Shape.mchp' not found //
// Warning: Hair cache file '062_grass.ma_green_grass_windSpeed3_Island4_HS_plants05_Shape.mchp' not found //
// Warning: This file contains an uncached hair system; rewind and playback to see correct current state. //

Any ideas on why this is? I know I created the cache file as I can see them in the data folder. Please help.

03 March 2011, 11:26 PM
Is that space character in the names a result of your cut and paste into CGTalk or is it in the actual file names?

03 March 2011, 08:54 AM
I downloaded the script from his site, extracted the winrar archive and the file had a space char in the name... I set the filename extensions to always visible in windows otherwise I wouldn't even recognized it.

03 March 2011, 05:07 PM
heres the actual screen shot of the error: (

03 March 2011, 06:39 PM
is there any possible way to render pfx grass in mental ray with out first converting to polys?

if not can anyone recommend a good shader or a way to make the poly conversion look good?


03 March 2011, 09:18 PM
You might check out this thread if you haven't:

Ultimately with the right lighting and shadowing the poly grass should look better than the pfx render. First make sure your grass geometry from the pfx to poly is fully flat strips and as low poly as possible( nearer grass may need more segments ). There is a pfx mesh quality menu that brings up an editor showing the brush and stroke attributes that control the output mesh density. It may also help to enable quad output on the stroke (or pfxHair node).

For distant grass I would go to texturing and shading on the ground combined with just sparce clumps of the taller grass. Even for close grass one might want some grass texturing on the ground underneath the poly grass to avoid requiring high density.

The effect of translucency on the leaves, as well as ambient light scattering are be important. There are numerous techniques for achieving this. You may prefer raytraced shadows, rather than depth maps, as the depth map resolution needs to be high for grass. Final gather can yield nice results but can be slow.

Instancing (of meshes... don't instance strokes) and perhaps mental ray proxies may be useful for populating the grass efficiently (in regions where you don't need to collide with your character).

03 March 2011, 12:34 AM
thanks your advice as always is greatly helpful

04 April 2011, 03:57 PM
got sort of a lighting question than a dynamic question but since this thread is all about my grass I figured id post here.

basically the grass has been set up, it is a very large grass scene btw. it dynamically moves with wind and is effected by characters. the grass has been cached and for the record is going to remain in its paint fx state and not be converted.

Up until now getting shadows to cast from the grass has been as simple as creating a light that creates depth map shadows. the shadows are casted on objects that have the use background texture.

we have completed several shots following the workflow of importing the grass file in the scene files. reconnecting the cache files. making sure the textures are use background and the lights are set up for depth map shadows.

now all of a sudden we are having some shots were there are no shadows coming up. we have checked all our workflow aspects as well as light linking, and checking the hypershade, etc etc. I currently don't know what else to do and am in need of any possible suggestions someone might have. Please any idea will be helpful.

Also, on a more dynamic note. The cache files that are being create work correctly in terms of when they are connected to the node with in the grass system the grass moves the way it should. however on some renders there will be a hair system that for some reason remains static and doesn't move. this is after scrubbing the timeline in maya to make sure all the grass behaved correctly.

Again please any help on either of these subjects is greatly needed and appreciated. thanks.

04 April 2011, 08:53 PM
In terms of the paint effects draw of hair updating there are many possible problem areas. The pfx display cache might not be getting dirtied, in which case a workaround might be create an expression that simply does "getAttr brush.time" for your brush( which would then dirty the cache). The hair system should be updating each frame from hairsystem cache, but the update is driven by draw events, so perhaps if you turned off display of something (like hairsystems or follicles) or hid some nodes it could be affecting the update. It can potentially help to force updates by creating an expression that calls "dgdirty -a". If that works you could make it more efficient by using dgdirty with a specific node name instead of the -a (all nodes) flag.

For the shots with no shadows try creating some non-pfx shadow casting geometry and see if that properly casts shadows into the depth maps. There used to be a bug where pfx only with no standard shadow casting geo would not trigger the shadow map pass. (can't remember the version where this was fixed) If you are not using a spotlight for the shadow maps then make sure the widthFocus on the light is properly set for your scene (might be a good idea to turn off autoFocus and set it manually). It needs to be just big enough to see shadows everywhere but small enough to preserve map resolution. A common goof can be a sky hemispherical mesh that does not have cast/recieve shadows = OFF and thus blocks any directional lights with shadows. (but you probably would have caught that)
Of course it is also good to double check that "cast shadows" is checked on for the hairSystemShape (under shading). If you have a pfx brush assigned the hair then also check that castShadows and realLights is on for the brush.

CGTalk Moderation
04 April 2011, 08:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.