new fur code(grass)


(pazur) #1

i`ve added alphagen vertex to 2nd stage of the blend terrain shader(1to2 etc). my fur grass still looks like it has 1 layer with .36


textures/natter/mxterra2_base

{
	qer_editorimage textures/common/terrain.tga
	q3map_texturesize 512 512
    q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )

    surfaceparm nolightmap
	q3map_forcesunlight
	q3map_globaltexture

    q3map_tcMod rotate 33

}

textures/natter/mxterra2_0
{
	qer_editorimage textures/natter/mxrock0b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
}

textures/natter/mxterra2_1
{
	qer_editorimage textures/natter/mxrock1b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock1b_n.tga
		rgbGen vertex
	}
}

textures/natter/mxterra2_2
{

	qer_editorimage textures/natter/mxrock2b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock2b_n.tga
		rgbGen vertex
	}
}

textures/natter/mxterra2_3
{
	qer_editorimage textures/natter/mxrock3g_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	{
		map textures/natter/mxrock3g_n.tga
		rgbGen vertex
	}
}

textures/natter/mxterra2_4
{
	qer_editorimage textures/natter/mxrock4b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	q3map_cloneshader textures/natter/grass
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
}

textures/natter/mxterra2_0to1
{
	qer_editorimage textures/natter/mxrock1b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock1b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
        alphaGen vertex
	}
}

textures/natter/mxterra2_0to2
{
	qer_editorimage textures/natter/mxrock2b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock2b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/mxterra2_0to3
{
	qer_editorimage textures/natter/mxrock3g_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock3g_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/mxterra2_0to4
{
	qer_editorimage textures/natter/mxrock4b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	q3map_cloneshader textures/natter/grass
	{
		map textures/natter/mxrock0b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock0b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}



textures/natter/mxterra2_1to2
{
	qer_editorimage textures/natter/mxrock2b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	{
		map textures/natter/mxrock1b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock2b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/mxterra2_1to3
{
	qer_editorimage textures/natter/mxrock3g_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	{
		map textures/natter/mxrock1b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock3g_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/mxterra2_1to4
{
	qer_editorimage textures/natter/mxrock4b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	q3map_cloneshader textures/natter/grass
	{
		map textures/natter/mxrock1b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock0b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}



textures/natter/mxterra2_2to3
{
	qer_editorimage textures/natter/mxrock3g_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	{
		map textures/natter/mxrock2b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock3g_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/mxterra2_2to4
{
	qer_editorimage textures/natter/mxrock4b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	q3map_cloneshader textures/natter/grass
	{
		map textures/natter/mxrock2b_n.tga
		rgbGen vertex
	}
	{
		map textures/natter/mxrock0b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}



textures/natter/mxterra2_3to4
{
	qer_editorimage textures/natter/mxrock4b_n.tga
	q3map_baseshader textures/natter/mxterra2_base
	surfaceparm grasssteps
	q3map_cloneshader textures/natter/grass
	{
		map textures/natter/mxrock3g_n.tga
	}
	{
		map textures/natter/mxrock0b_n.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
		alphaGen vertex
	}
}

textures/natter/natterterrain
{
	qer_editorimage textures/common/terrain.tga
	q3map_terrain
	surfaceparm grasssteps
	surfaceparm nodraw
	surfaceparm nolightmap
}

textures/natter/grass
{
	qer_editorimage textures/natter/grass.tga
	q3map_notjunc
	q3map_nonplanar
	q3map_bounce 0.0
	q3map_fur 6 2 0.15
	//q3map_fur 8 1.25 0.1
	q3map_forcesunlight
	q3map_globaltexture

	surfaceparm nolightmap
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm noimpact
	nomipmaps
	sort 7

	{
		map textures/natter/grass.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen vertex
	}
}


(pazur) #2

ydnar. could u plz go quickly through the shader to tell me why my fur looks so different with .36? and what to add or remove to make it work with .36 . thanks in advance


(ydnar) #3

Post screenshots. I cannot divine what you are talking about from the shader alone.

y


(pazur) #4

ok. here we go:

(grass_32.jpg, grass_36.jpg)
http://www.geocities.com/pazurmapping/screenshots/

i hope u see the difference


(ydnar) #5

I don’t see any difference in the grass.

What’s with the door ent in the 3rd screenshot? What compiled it correctly before?

y


(pazur) #6

the door is something different. i solved that problem already(brush cleanup helped there)

format: q3map_fur <layers> <offset> <fade>

i have: q3map_fur 6 2 0.15

so 6 layers. with .36 it looks like 1 layer

edit: better screenshots with white tex behind the grass :slight_smile:

(white_grass_32.jpg ,white_grass_36.jpg)
http://www.geocities.com/pazurmapping/screenshots/


(ydnar) #7

Does it ever look higher on areas where the terrain is completely made up of the grass shader? I made a change to the fur code where the original vertex alpha would fade the distance the fur stuck out from the surface.

Just checked the code again. It seems it’s offsetting each fur layer off the initial layer, as opposed to the previous layer, which is why you only see two layers of fur.

This bug will be fixed in the next release.

y


(pazur) #8

big big thx :smiley: