SteamVR

SteamVR

SteamVR Workshop
Customize your SteamVR experience by finding new backgrounds, 3D environments, controllers and base station models.
Learn More
Praxeos1 4 13 Jun, 2019 @ 1:54pm
Swaying Trees
I'm working on my first outdoor environment and I want to add a few swaying trees and plants. I hoped it would be as simple as checking the "enable wind" box in the material editor, but that turned my preview icon to a pink and black checker pattern, and displayed as a "broken" red wireframe texture in-game. I tried adding env_wind and following the instructions at https://developer.valvesoftware.com/wiki/$treeSway and https://gamebanana.com/tuts/12924, but without success. I may have edited the script incorrectly, but I suspect those tutorials are not applicable to the SteamVR Environments. They refer to VMT, instead of VMAT, and the syntax for the parameters is full of dollar signs ($), which I don't see in the VMAT.

How does one create the wind effect for plants in SteamVR?

This will be my first attempt at a tree, but I imagine that I would make the trunk and large branches as a single mesh, with either a tiled or UV-mapped bark material. I would then group it with multiple individual quads with alpha-tested, double-faced materials for leaves and small branches. Assuming that's the correct approach, are there any tricks to making the trunk/modeled branches and leaves/2-d branches move naturally in relation to each other?
< >
Showing 1-8 of 8 comments
Rectus 13 14 Jun, 2019 @ 12:45am 
Yeah, those tutorials are for Source 1 games. There is a wind effect available in the material editor for the standard shader. It's at the very bottom of the list, tick Enable Wind and you get a bunch of options to play with. I don't think the effect is affected by env_wind though. Make sure to have a map running to see the wind effect in the editor.
Rectus 13 14 Jun, 2019 @ 1:30am 
Actually it seems env_wind does affect the shader. You can set the wind paramters for the editor with the r_world_wind_ console commands.

Also, looks like they added masks for what part of the UV gets affected by the wind, so now I can make my slalom gate flags attach to the poles.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1769551975
Last edited by Rectus; 14 Jun, 2019 @ 1:42am
Steve 14 Jun, 2019 @ 6:11am 
The pink checkerboard error that your referring to is because of a missing texture, this is a bug with the SteamVR Home tools, the default wind noise texture is missing in the sdk materials/dev/two_channel_noise.
To fix this create a psd named two_channel_noise and place it in your addons material/dev/ folder.
Hopefully Valve can put out a fix for this, Ideally, two_channel_noise should be moved to core\materials\default\ so that it ships with the sdk, but this would require a one-line shader change.
Last edited by Steve; 14 Jun, 2019 @ 6:11am
Praxeos1 4 14 Jun, 2019 @ 8:46am 
Thank you both! I didn't notice that additional parameters and image file slots appeared on the right after I checked "enable wind." If I had simply scrolled down, I would have seen the "two_channel_noise" issue. I suppose any image with random noise will do. After adding a psd with black-and-white noise, I was able to get my test material to display and move in-game. Now, it's on to the tedious task of experimenting with settings. I'll try creating some masks too. The slalom gate flag looks great!
Rectus 13 14 Jun, 2019 @ 8:51am 
There should already be a noise texture with a different name in the game files.
Last edited by Rectus; 14 Jun, 2019 @ 8:51am
athynoice 8 Jul, 2019 @ 10:41am 
++ nicce
Steve 11 Jul, 2019 @ 4:54pm 
Valve shipped an update that adds the missing texture files, so you should no longer find issues when creating materials that use wind.
steamvr_environments\content\core\materials\dev\ now contains the missing wind noise texture.

Credit to JoeD at Valve who patched this super quick!
Praxeos1 4 11 Jul, 2019 @ 6:16pm 
Nice. Thanks!
< >
Showing 1-8 of 8 comments
Per page: 1530 50