Foliage problem


(jimlajungle) #21

I’m using this one for my own foliage:

models/workmap_foliage/w_grass_foliage1
{
	nopicmip
	qer_alphafunc greater 0.5
	cull disable

	distanceCull 0 0 0.49
	sort seethrough
	surfaceparm pointlight
	surfaceparm trans
	surfaceparm nomarks
	nopicmip
	deformVertexes wave 15 sin 0 1 0 0.25
	{
		map models/foliage/grassfoliage1.tga
		alphaFunc GE128
		rgbGen exactVertex
		alphaGen vertex
	}
}

textures/temperate_workmap/base
{
	nopicmips
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_nonplanar
	q3map_shadeangle 155
	q3map_forcemeta
	q3map_tcGen ivector ( 64 0 0 ) ( 0 64 0 )
}

textures/temperate_workmap/grass1_grass2
{
	q3map_baseshader textures/temperate_workmap/base
	qer_editorimage textures/temperate_sd/grass_path1.tga

	q3map_foliage models/workmap_foliage/w_grass_foliage1.mdc  0.6 48 0.08 2

	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/grass_path1.tga
		rgbgen identity
	}
	{
		lightmap $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
	}
}

I’m getting this kind of result:


It’s not a nextgen one, but it’s ok for me.

So maybe you can try to adapt it to your needs.


(RayBan) #22

Thats fine looking foliage… =)


(FrostyChilli) #23

This does look good. I might even use your shader in one of my maps.

A question. “models/workmap_foliage/w_grass_foliage1”. Is that .md3 file?
And “textures/temperate_workmap/base”. Is that a .tga file?
Sorry if these are too trivial questions, but I would really like to understand this system.

Thanks!

Cheers,
Frosty!


(Mateos) #24

Yes, by the paths you can guess.


(jimlajungle) #25

I might even use your shader in one of my maps.

Well, RayBan’s “Foliage Example” map helped me a lot with, so you can use it too.

Note: rename the file from “foliage_example_2.rar” to “foliage_example_2.zip”.

“models/workmap_foliage/w_grass_foliage1”. Is that .md3 file?

Yes, MDC models file format was introducted with Return To Castle Wolfenstein to deal with static models in replacement of MD3 format, but it’s equivalent to MD3. You can find it in the foliage example map PK3 archive into the “models/rayban_foliage” folder.

And “textures/temperate_workmap/base”. Is that a .tga file?

No. “textures/temperate_workmap/base” is an implicit shader used only by q3map2 to do some work about precomputing light and shadows as the engine uses static shadows. Just look above “grass1_grass2” shader into the code from my previous message.

Thanks! As I said your map (I think it’s yours) helped me a lot with foliage, terrain and light… :slight_smile: