Moving Grass

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Captain Den
Lance Corporal
Posts: 10
Joined: Wed Apr 27, 2005 12:21 pm
Location: Germany
Contact:

Moving Grass

Post 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? :)
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post 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'
ImageImage
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Image
aazumak
Lance Corporal
Posts: 24
Joined: Mon Apr 25, 2005 1:11 am

Post 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?
Captain Den
Lance Corporal
Posts: 10
Joined: Wed Apr 27, 2005 12:21 pm
Location: Germany
Contact:

Post 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?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
Post Reply