Terrain problem.


(Thej) #1

hello, i have a problem with my terrain, the texture scales are ok, but the blending part is wrongly scaled, i tried several things, but nothing works.

this is what it looks like now http://www.headstompers.com/shot0091.jpg

u can have a look at the shader here http://www.headstompers.com/jacco1.doc

I hope u guys can help me out :smiley:


(chavo_one) #2

A word doc?! ugh.

I think the reason why the blended stage isn’t working in comparison to the others is because you have scaled down the grass texture but not the rock texture.


textures/jacco1/terrain_0to1
{
q3map_baseshader textures/jacco1/terrain_base
	
	{
		map textures/temperate_sd/grass_dense1.tga
		tcmod scale 0.1 0.1

	}
	{
		map textures/temperate_sd/rock_ugly_brown.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}


(Thej) #3

Well i tried that, but no luck :<

thx for the fast reply anyways :cool:

Lol, next time i change something in shader file i should maybe save it :banghead:

Fixed now :smiley:


(ydnar) #4

Don’t use TA-style terrain shaders with Q3Map2. There is a better, faster alternative.

Read the file lmt.txt for an example on how to convert your terrain shaders.

Even if you don’t use lightmapped terrain, you should definitely be using q3map_tcGen to set the texture coordinates instead of those per-stage tcMod scale directives.

Also, make sure your terrain shader is listed in shaderlist.txt.

y


(Thej) #5

Hmm, what do u mean with TA-style terrainshaders?

I used the terrain shader from battery as an example :smiley:

But at least now i know how to scale my textures, so thx for the help :slight_smile:

One question though.

Do u have an example of a vertix lit terrain shader with q3map2?
cause for some reason, my old vertex lit terrain dont work anymore with the latest build of gtkradiant :<

Or could that be cause i have more then one GTKradiant installed?
Ow and i noticed the new build makes a TGA file from the map :cool:


(Thej) #6

well i got the terrain textures working now, but now i seem to be having a problem with my fog :disgust:
cause it doesnt seem to like Lightmapped terrain very much :angry:

This is how it looks like http://www.headstompers.com/shot0100.jpg
U see how the building looks strangely lit now.

i made a fog shader and this is the code

textures/eagle/Sky
{
qer_editorimage textures/eagle/sky_m01dmcmp
surfaceparm noimpact
surfaceparm nodlight
//surfaceparm nolightmap
surfaceparm sky
surfaceparm nomarks
q3map_globaltexture
q3map_lightsubdivide 2048
q3map_surfacelight 35
skyparms full 300 -
fogvars ( .75 .75 .75 ) 2300
{
map textures/eagle/sky_m01dmcmp.tga
tcMod scale 12.0 12.0
}
}

here is the terrain shader:
(specially for Wils :smiley: )

textures/lightmap/terrain_0
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 400 0 0 ) ( 0 400 0 )
{
map textures/temperate_sd/grass_path1.tga
rgbgen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbgen identity
}
}

textures/lightmap/terrain_1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 400 0 0 ) ( 0 400 0 )
{
map textures/temperate_sd/master_grass_dirt3.tga
rgbgen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbgen identity
}
}

textures/lightmap/terrain_2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/temperate_sd/dirt3.tga
rgbgen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbgen identity
}
}

textures/lightmap/terrain_0to1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 400 0 0 ) ( 0 400 0 )

{
	map textures/temperate_sd/grass_path1.tga
	rgbgen identity
}
{
	map textures/temperate_sd/master_grass_dirt3.tga
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	rgbgen identity
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
	rgbgen identity
}

}

textures/lightmap/terrain_0to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 400 0 0 ) ( 0 400 0 )

{
	map textures/temperate_sd/grass_path1.tga
	rgbgen identity
}
{
	map textures/temperate_sd/dirt3.tga
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	rgbgen identity
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
	rgbgen identity
}

}

textures/lightmap/terrain_1to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 400 0 0 ) ( 0 400 0 )

{
	map textures/temperate_sd/master_grass_dirt3.tga
	rgbgen identity
}
{
	map textures/temperate_sd/dirt3.tga
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	rgbgen identity

}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
	rgbgen identity
}

}

textures/lightmap/terrain.vertex
{
{
map textures/temperate_sd/dirt3.tga
rgbGen vertex
}
}

Any help would be apreciated :smiley:

Thej