Page 1 of 1
Moving Grass
Posted: Tue May 31, 2005 10:02 am
by Captain Den
Hi!
In an included map in the Hell in the pacific - mod I saw grass moving in the wind. I think it was made by normal brushes!? Could someone tell me how that works?

Posted: Tue May 31, 2005 10:54 am
by Mj
You need to be looking in the .shader file
The line is something like: deformVertexes 20 10 0.4 2
Look in pk0 >> shaders >> ocean.shader and find that line ^
What it does is to deform the brush so it 'waves'
Posted: Tue May 31, 2005 10:55 am
by bdbodger
I did some corn in a map that did that . What I did was make a texture of a stalk of corn . I applied that texture to triangle shaped brushes that had nodraw on the top and bottom and the corn texture on the other 3 sides . The secret is the shader
Code: Select all
textures/corn/corn
{
qer_editorimage textures/corn/corn.tga
qer_keyword masked
qer_keyword foliage
// surfaceparm fence
surfaceparm noimpact
surfaceparm nonsolid
surfaceparm alphashadow
cull none
// deformVertexes flap <s|t> <div> <function><base> <amplitude> <phase> <frequency> <optional min> <optional max>
deformVertexes flap t 80 sin 0 5 0.2 0.25 1 0
nopicmip
{
map textures/corn/corn.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
//s|t
//div
//function
//base basic deformation
//amplitude how wide does it sway
//phase start anim with s/th different than 0 (value 0-0.99)
//frequency how fast does it
//optional min factor for deform at min
//optional max factor for deform at max
deformVertexes flap is what makes it sway in the wind that is also used for flags as well to make them flap
Posted: Wed Jun 01, 2005 1:00 am
by aazumak
so that makes that texture sway? i mean everywhere? how would i make it so it swayed in someplaces? o wait nvrmind. make corn 1 sawy and corn 2 not sway. also the numbers. how would i make it so sat only the top swayed while the bottom stayed put?
Posted: Wed Jun 01, 2005 9:54 am
by Captain Den
Ah okay ! Thx for your help! I will test it immediately when I'm back from work

By the way - does this grass-action have an influence on the fps?
Posted: Wed Jun 01, 2005 1:00 pm
by bdbodger
too much grass will have an effect like any texture will . Depends on the brush count etc . The grass texture will have an alpha channel and be partly transparent so it won't effect vis data size since transparent textures are not used dureing vis compileing. Just don't go crazy with it thats all do some test maps first maybe .