Swaying Trees on ALL Source Games

A Tutorial for Source Engine

Members see zero ads. Membership is 100% free

Swaying trees without $treeSway parameter.

Swaying trees without $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 (bugged as of may 2019)

There's a workaround for this, and is pretty simple actually.

This works for all games:
Just 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 change the sineperiod for slower/faster swaying
You can add anything you like to make the apparent swaying motion more random.

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, it might need some adjusting.

This is effect costs virtually no fps.

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

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 5y ago
Ripe Supporter
Offline
Apocalyptic Flag Affiliation: Apocalyptic
5,469 points Ranked 1164th
45 medals 4 legendary 10 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 5y ago
Ripe Supporter
There
Apocalyptic Flag Affiliation: Apocalyptic
5,469 points Ranked 1164th
45 medals 4 legendary 10 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
  • 6
  • 1.1k
  • 1
  • 24d
  • 23d

More from Submitter

WiPs by Submitter

More Other/Misc Tutorials