Reply
Reply
 
Thread Tools Display Modes
Zipfinator's Avatar
Old (#1)
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.
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

Oniram's Avatar
Old (#2)
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.
Offline , card carrying polycounter, 2,029 Posts, Join Date Apr 2007, Location Belmont, CA Send a message via Skype™ to Oniram  
   Reply With Quote

Zipfinator's Avatar
Old (#3)
Quote:
Originally Posted by Oniram View Post
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.
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

Zipfinator's Avatar
Old (#4)
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?
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

rasmus's Avatar
Old (#5)
Something like this maybe? http://forums.epicgames.com/showthread.php?t=718347
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Zipfinator's Avatar
Old (#6)
Quote:
Originally Posted by rasmus View Post
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.
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

JZeeba's Avatar
Old (#7)
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
Offline , spline, 195 Posts, Join Date Nov 2010, Location Mexico - land of no law and corruption everywhere  
   Reply With Quote

sprunghunt's Avatar
Old (#8)
Some further reading:
http://udn.epicgames.com/Three/WorldPositionOffset.html
http://udn.epicgames.com/Three/Inter...iageActor.html
---------------------------------------
sci-fi base
Robot Hunters Room
CER level
Offline , polycounter, 1,284 Posts, Join Date Apr 2005, Location Massachusetts  
   Reply With Quote

Zipfinator's Avatar
Old (#9)
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!
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

A. Rabbit's Avatar
Old (#10)
Glad the post was useful, I might have to update that shader with a newer version when I get time. ;)
Offline , null, 9 Posts, Join Date Aug 2010,  
   Reply With Quote

Zipfinator's Avatar
Old (#11)
Quote:
Originally Posted by A. Rabbit View Post
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.
Offline , card carrying polycounter, 2,344 Posts, Join Date Aug 2008, Location Chico, California  
   Reply With Quote

A. Rabbit's Avatar
Old (#12)
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.

Last edited by A. Rabbit; 04-12-2011 at 01:44 AM..
Offline , null, 9 Posts, Join Date Aug 2010,  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch