PDA

View Full Version : Swaying Trees


Zipfinator
04-04-2011, 03:26 PM
I recently started a nature scene in UDK and was wondering what's the best way to go about making trees and foliage sway in the wind? Is there any way to have it automatic or will I have to animate them? In the L4D2 Source Engine there's just a few commands that you plug into your material to make the trees sway but I haven't seen anything like that for UDK.

Thanks.

Oniram
04-04-2011, 03:40 PM
well there is speedtree, but i dont know how familiar with that you are. you can do it through the material editor but thats a lengthy proces. you may want to check through Adam's lengthy evil genius hidden forest base thread to see if he mentions anything about that in there.

Zipfinator
04-04-2011, 03:43 PM
well there is speedtree, but i dont know how familiar with that you are. you can do it through the material editor but thats a lengthy proces. you may want to check through Adam's lengthy evil genius hidden forest base thread to see if he mentions anything about that in there.

Forgot about that thread. I'll definitely take a look through there later, although I don't recall him ever mentioning anything about it in there.

I'd rather not use Speed Tree, but thanks for the suggestion. If doing it through materials isn't that feasible then I'll probably just animate them.

Zipfinator
04-04-2011, 03:53 PM
Looking through the GDC 2010 Foliage Map it looks like they set up their static meshes to sway based on WindDirectionalSource actors. It looks like the canopies on the static foliage are set up with jigglebones or something and the WindDirectionalSources determine how much the jigglebones sway.

Does anyone have any idea exactly how they set the foliage up to utilize the WindDirectionalSources?

rasmus
04-04-2011, 09:44 PM
Something like this maybe? http://forums.epicgames.com/showthread.php?t=718347

Zipfinator
04-04-2011, 11:34 PM
Something like this maybe? http://forums.epicgames.com/showthread.php?t=718347

That's probably the closest thing to what I'm looking for. Thanks for posting it. It's a bit complex though. I'll take a closer look at the GDC 2010 assets to see how they did it and if I can't find out I'll probably set that up.

JZeeba
04-08-2011, 11:32 AM
Hey Zipfinator,
A friend of mine has this tutorial (http://eat3d.com/udk_cinematics) and I believe they mention that in a section called "modifying plants", I'll ask him how they did it :)

sprunghunt
04-08-2011, 11:53 AM
Some further reading:
http://udn.epicgames.com/Three/WorldPositionOffset.html
http://udn.epicgames.com/Three/InteractiveFoliageActor.html

Zipfinator
04-08-2011, 01:43 PM
After a few hours of messing around I got the vertex shader from the thread Rasmus posted hooked up and have gotten comfortable messing around with the values in it. It looks alright and will definitely be acceptable to use in the flythrough video I'd like to do.

@Jzeeba, thanks. Would be nice to see how other people have set similar things up.

@Sprunghunt, thanks for the links!

A. Rabbit
04-11-2011, 03:43 PM
Glad the post was useful, I might have to update that shader with a newer version when I get time. ;)

Zipfinator
04-11-2011, 11:23 PM
Glad the post was useful, I might have to update that shader with a newer version when I get time. ;)

That would be great. One thing I'd like (That could be in the shader already but I just didn't find the right settings to change) is to have the bottom of the object able to be still. I'm using this on some trees and it looks fine on the leaves but when I put it on the trunk it looks awkward with the bottom swaying around. I got it to look alright by just toning it down to where the movement near the bottom won't be as noticeable but it'd be nice to be able to have the top branches sway more.

A. Rabbit
04-12-2011, 01:29 AM
Yea it uses the meshes red vertex color to determine sway strength. A good way to mask foliage is to bake it in your 3d package. This is achieved by setting up a point light at the plant/trees base, by making the light 'emit ambient' and then baking the light into vertices.

There is also a way to generate a spherical fall off within a material but this both costs performance and isn't very flexible.