Jump to content

Grass Displacement with Moving Camera


georgesvalera
 Share

Recommended Posts

Hi,

 

I have a very annoying problem for couple of days now, and cannot get rid of it. Any help would be really thankful.

The main thing is, i have been trying to put grass on a huge grassfield by using standard materials with displacement height maps in mental ray connection rollout on material panel. (for height map i tried out noise, dents, bitmap, whatever)

The problem occured, that either the nice grass rendered were flickering the minute the camera moved and also showing some other smaller render anomalies like misterious poligons, or, with different settings, it was not flickering, but could have filled only the 1% of the field with grass before freezing.

 

And from now i try to give the settings details below:

 

A. (View checked, Face Length=0,5 pixel, Max Displacement=100, Max Level=6)

When i had to give values in pixels there, the render in stills were quite nice, the subdivision made has created quite the appropriate illusion of grass i was looking for, and for the whole huge grassfield. But there were two errors. 1. when i moved the camera, the grass immediately began to flicker, as it would have tried to render differently the grass in each frame, and it was surely created by the displacement and not by other maps. And 2., at some not level surfaces the inside poligons could have been seen on the render, for some reason, even if i used mesh smooth with any iterations, on the render slightly could have been seen some annoying pattern of poligons, or squares. Thus, because of these two problems, i gave up this method, and tried the Displacement render option with unchecked View, giving the values not in pixels but scene size.

 

B. (View unchecked, Face Length=1, Max Displacement=100, Max Level=7, Smooth unchecked)

In this case the problem came, that MR tried to make subdivisions for grass creation in each poligons, depending on its size. and therefore i just couldnt put grass as simply as before to the whole surface of the scene grassfield with equal density and quality as mentioned above, but i had to subdivide manually the poligons of the grassfield object to achieve an acceptable level of grass at the cost of settings Max Level=7. Because it turned out the amount of grass max rendered inside a certain poligon depended on its size. The problem in this case was, that it just froze because of the number of poligons, and not even filling the whole grassfield.

And i cannot make the field size smaller. It is given.

 

Any help i would appreciate. Or if anybody has some trick or method to create grass on a huge field, where in case of a moving camera the illusion of grass still remains, and gives more out of the scene then a simple bumpmapping, i would really be touched to hear about. (You know, its quite annoying, when i still see flickering grass in the pub late night looking at girls displacement maps...)

 

Thanks a lot guys.

 

"sub pondere crescit palma"

Link to comment
Share on other sites

I think you maybe need to rethink your camera view. If you cant force your machiune to render a wole field of individual blades of grass (understandable) maybe you will have to do it a s a texture and keep it at a distance. Or you could render a foreground and a background pass and a zdepth blend in AE. Then only about the nearest few meters need to be displaced.

Link to comment
Share on other sites

Thanks Tom,

 

That will be great for plan B!

But actually, im wondering why in the first case mentioned this flickering and poligon-anomalia happens, i must think of that i just might have made some wrong render settings..

 

Still, if anyone has bumped into some similar, i would gladly listen to it!

Link to comment
Share on other sites

Ive had similar problems with a rug crawling in vray. It looked like the orientation of the displacement shifted on differing polygons and created a trianular crawling effect. I think its a problem with the diplacement being a view dependent effect.

I havnt tried using displacement in an animation since, but as i mentioned before, you'll need a powerful renderfarm or a post effect workaround to get a whole field of grass to displace smoothly.

Link to comment
Share on other sites

Its the noise map, being a procedural map it recreats itself differently for every frame, thus the flickering/crawling.

 

Rather use a tileless bitmap

 

A possible suggestion is to put the displacment shader in mix map with a fall-off shader set to distance as the mix amount between the displaced and non displaced grass. This way only the grass close to the camera gets displaced and not in the distance.

 

JHV

Link to comment
Share on other sites

Hi,

 

I had the exact same problem not long ago! See my post:

 

http://www.cgarchitect.com/vb/23101-displacement-dilemma.html

 

Sorry but there were no replies?

 

I tried using a bitmap for the displacement (noise created in ps) and still got flickering (as you say - something to do with the subdivision). In the end I settled for a material that used two mix maps (two grass bitmaps and one dirt, mixed with largish noise maps) applied bump with the same noise-like bitmap that I'd tried to use for displacement. To make it look more believeable I lifted the camera up 500-600mm to avoid being as close at a side-on angle.

 

I then dotted lots of various sized and scaled grass tufts around the grass area (3d modeled geometery). This made it look almost better than the displaced grass (and a lot faster to render - without the flickering). This might not be so suitable for a perfectly manicured lawn however. The trick is to play with the maps, noise size and bump to try and get something realistic!

 

I might try Justins falloff method next! Let us know what solution you reach..... Good luck!

Link to comment
Share on other sites

Thanks for the posts guys.

 

Without the intention to bore anyone, i share this few hours experience:

 

actually, i have tried before the same that Justin adviced, namely replacing all procedural maps with bitmaps, and a certain amount of flickering i managed to get rid of, but still, when i was still using view dependent displacement, some amount remained. And by coincidence i noticed, that this smaller kind of flickering came from the self-shadows of the displaced grass blades. (Self-shadow here i mean the darker tones part of a body, and not projected shadow.) At this point i was using rare white circles spots on black background for displacement map, just to understand how it works, and the test scene was one box and an omni light only.

So i tried to figure out how can flickering come from 'self-shadows', so i made a render from top view of the grass field thus saving shadow information into a texture map, and then i reused this map as diffuse map with 100% self-illumination on the grassfield material, plus excluding the grassfield object from all kind of illumination and shadow receive. I thought it will work, cause now it was just pure texture on it and no shadows.

But the view dependent Displacement still made that small flickering. Actually its not so annoying, it might look like a soft breeze touching the grass, because only 0.5-1% of the blades flickers like kind of moving, but i didnt want this effect, so i gave it up.

 

Anyway, i'm about to try out the way Tom and Macer said, with tons of poligons... :cool:

thanks guys

Link to comment
Share on other sites

Another thing worth a try is to check your AA filter... i have found that using the video filter which is described as "A 25 pixel blurring filter optimized for NTSC & PAL video application" helps dramatically in reducing the flickering incurred from displacement and camera movement opposed to using the standard Area filter

 

You may already being this however??

Link to comment
Share on other sites

Sorry George my mistake... didn't entirely appreciate that you are using Mental Ray. The Filter is availble in Vray and as you mention also in scanline. I would presume that one of the presets in MentalRay is similar, maybe its worth experimenting with a little. If not manually adjusting the alaising might be an option.

 

I've never really used MentalRay so wouldn't like to say which to try 1st!

 

Although not directly applicable to MentalRay the following link illustrates the effects that different filters can have on the final render. Look at example 9.

 

http://www.spot3d.com/vray/help/150R1/examples_image_sampler.htm

Link to comment
Share on other sites

no problem James,

 

actually, another question occured to me about image sampling,

i need to render some shapes of thin red lines moving in a black background and the final product will be 35mm film.

Do u have any idea which filter is the best for this kind of render to avoid flickering of sharp contrasted edges and other awesome things?

Link to comment
Share on other sites

Not sure if this is still an issue for you, but I'm going to paste in a reply to a question I answered on CGTalk which had the same problem as your grass:

 

"I believe Mental Ray's displacement to be view dependent because that way as polygons recede away from the camera, MR builds less and less of them because they become too small to see. This means if your camera moves throughout a scene that might have areas with high contrast and very fine detail in the displacement map, they might suddenly appear to snap into existence or be culled flat depending on how the camera moves. The reason for this is much faster rendering of displacement effects (near objects get high levels of displacement, far away get almost nothing) and also less memory hit - far off objects require little or no displacement and therefore eat less RAM.

 

Unfortunately you have made a scene where turning the View dependent setting off sounds like a good idea, but you will have to suffer the consequences of longer render times and will need to adjust the edge length until the scene looks the way it did using view dependent.

 

Well that's my understanding of it, but if any MR experts want to add their opinion I'd be happy to be correctedsmile.gif"

 

You can find the option to turn off view dependent in the renderer in the displacement options section. Hope that helps you.

Link to comment
Share on other sites

Hi all,

 

I can hardly believe this, but imho the problem is NOT in the displacement, but in the resolution... Grass blades are VERY thin objects, and video res is very low, about 720 wide... ;-p

I assume you want more than 720 blades next to each other..; and so how would you do it if you were a machine??? Basicly, one would have to drop 'real-world sub-pixels' because these are not allowed in video res... Or how to make the difference of 20 different grades on ONE pixel... one can't...

So the machine averages these things out... Result: Moiré... Noise...

Only thing you can do is blur or use a texture map... Or render at a higher resolution and downscale to get a better average... (almost the same as rendering 4-16 or 16-1 image sampling... ow ow ow killing rendertimes!!)

 

nisus

Link to comment
Share on other sites

Nisus,

Im not sure youre right this time. Ive had the exact same problem as stated in the first post of this thread, where the undesirable shift in displacement rendering seems to be polygon related. In the render it looks as though theres overlapping geometry on a displaced element, even when the element itself is not subdivided, or even like a normals issue. I never got to the bottom of it (this was vray 1.46) and I had th same problem in stills as well. But the moire effect would not result in geometric patterning on the render(?).

My solution only ever got half done, then time ran out. But that was to do a depth pass and matte the displaced geometry and comp a better quality of displacement in post. Since then, Ive not had to animate displaced grass.

I would love to see someone post a brilliant solution!

 

Whoops, just realized this is a MR issue.

Link to comment
Share on other sites

hi nisus,

 

it cannot be a resolution problem due to the fact that in a very close zoom where the blade are like big cones, this flickering still appears, and it seems now that the main reason for this is the self-shadows of the generated blades. This shadows on the blades' darker sides seem to be regenerated each frame and dependently on the view.

Though these strange poligons are still a question..

 

Anyhow im trying to use just hair and fur wsm instead of displacement, and it seems to work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...