GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Swaying Trees on ALL Source Games

A Tutorial for Source Engine

Swaying trees without $treeSway parameter.

This is a tutorial for games that  do not  support $treeSway.

$treeSway is a VMT texture parameter that allows trees and such to appear to sway from the wind. However this is not supported on older games such as CS:S, HL2 etc.
It actually exists in GMod but flickers when lit by flashlight

So here's how to achieve similar effect without $treeSway:

It won't actually bend the trees, but works as good for slight wind swaying.
-Find what texture the leaves of the trees use, and open the VMT.
-Next, add these proxies to it

"$translate" "[0 0]"

"Proxies"
{
Sine
{
sineperiod 4
sinemin 0
sinemax 0.005
timeoffset 0
resultVar "$translate[0]"
}
Sine
{
sineperiod 5.5
sinemin 0
sinemax 0.005
timeoffset 0
resultVar "$translate[1]"
}

TextureTransform
{
translateVar $translate
resultVar $basetexturetransform
}
}

You can scale the sineperiod values for slower/faster movement.

Note:
If you see unexpected results, you'll need to tweak the sinemin and sinemax parameters.
That's because these values were typed in for a specific tree, and since we generally dont know what the UV map of each tree looks like, the values might need some adjusting.

I don't know if a whole forest of trees with this will make it lag, but this effect costs virtually no fps if you see a small number of trees with this, at once (in the PVS).

Well, happy mapping! (with swaying trees :) )

Sign up to access this!

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Creator
NvC_DmN_CH avatar Apocalyptic Flag
Affiliation
Apocalyptic
NvC_DmN_CH username pic Joined 6y ago
Offline
Apocalyptic Flag Affiliation: Apocalyptic
10,363 points Ranked 592nd
48 medals 4 legendary 12 rare
  • Returned 5000 times Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
  • 1st Place - The Heatwave Skinning Contest Medal icon
  • Became a Ripe Supporter Medal icon
  • Submitted 20 Gamefiles Medal icon
  • 3rd Place - The
Creator

Submitter

NvC_DmN_CH avatar
NvC_DmN_CH username pic Joined 6y ago
There
Apocalyptic Flag Affiliation: Apocalyptic
10,363 points Ranked 592nd
48 medals 4 legendary 12 rare
  • Returned 5000 times Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
  • 1st Place - The Heatwave Skinning Contest Medal icon
  • Became a Ripe Supporter Medal icon
  • Submitted 20 Gamefiles Medal icon
  • 3rd Place - The
NvC_DmN_CH avatar
NvC_DmN_CH
Apocalyptic Flag
Affiliation
Apocalyptic

Creator
  • Paypal Donate
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Beginner

Attributes

Genre
Texturing

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Today's Pick
    Featured on May 1 2019
  • 7
  • 5.6k
  • 3
  • 1y
  • 3mo

More from Submitter

WiPs by Submitter

More Other/Misc Tutorials