Download

Applying wind to map foliage globally

Hello all,

I’ve created a weather controller actor for game I’m creating that procedurally generates storms while the game is running. It controls rain, fog, sky color, cumulous cloud cover, storm surge, lightning, and of course, wind. These storms are governed by a mathematical model that determines the values of all these parameters appropriately and then takes necessary action to control various in-game effects. A combination of controlling a lighting bolt spawning actor, controlling water z-axis heights, controlling the sky sphere’s parameters of interest, and control over particle effects for rain and fog are done all by this actor.

Then, there’s wind. Wind tilts the rain and makes the fog move by the screen faster, but I also want to have it effect my foliage.

I have been searching for a way to dynamically change parameters that govern wind in all of my materials during game runtime, such that my weather controller can access this and change it as appropriate for the weather. I have read about the Wind Directional Source actor that can be placed and altered during run-time in UE4, but unfortunately, it also seems to be limited, to the best of my knowledge and research, to controlling wind effects only on foliage or meshes created using SpeedTree.

We have foliage on our map from several different asset packs we’ve bought on the UE4 marketplace, none of which are created using SpeedTree. They also seem to be, for the most part, governed by parent material blueprints such as this:

Capture.JPG

I have not been able to figure out a means to control these wind parameters that govern how windy the foliage looks in run-time, and my searches have only turned up use of SpeedTree / the Wind Directional Source for such purposes.

Is there any other way to do this? I just need to change these parameters in-game while it’s running such that all the foliage childed to this material changes dynamically, rather than statically.

Use material parameter collection to store wind direction and intensity and hook it up to every foliage material you have.

Alright, thanks! Found a good link for it.

It looks like it may do exactly what I need.