Bubbers / Bubba-3D

3D game engine using OpenGL.
https://bubbers.github.io/Bubba-3D/
GNU Lesser General Public License v3.0
9 stars 1 forks source link

Added GPU based wind #95

Closed Bubbad closed 6 years ago

Bubbad commented 6 years ago

How an object is affected by wind is painted as vertex colors on the object as described in https://mtnphil.wordpress.com/2011/10/18/wind-animations-for-vegetation/ with the difference that the branch attenuation is inverted when coloring, not in shaders.

A scene now has a global wind. Objects are by default not affected by it, but can be if affectedByWind attribute is set on it. An object can be affected in three different ways; stem, branch and leaf bending (see article above), which are specified on the object itself. (It needs to be on the GameObject as the renderer sets this information)