Easygen terrain blending problems


(StormShadow) #1

Ive already searched for this, but cant find anything that helps.

Right now im in the process of adding terrain into a map. Ive created the terrain in Easygen, and exported to .map using a woflet template. Upon compiling and loading the map in-game, i get the following results:

The area where the terrain actually blends looks fine… but there is clearly a seam between the base texture and the blend texture.

Ive already tried the following:

  1. used the q3map2 template for exporting the terrain - the result i got was no visible seam, but the textures were very small and paneled. I couldnt correct this.

  2. i tried using the default template, which yeilded the same result as the wolfet template

  3. i lowered the tcmod scale from .125 to .04 - same result, but the texture looked resized.

I’ve used easygen w/ wolfet template before for terrain, and never had this issue. Any ideas?

Thx in advance.


(rgoer) #2

There is a bug with the way EasyGen generates shaders (even with the new ET templates for q3map2). EasyGen creates the baseshader last, and puts it at the end of the file… in order to have your shader work correctly (not have small bordered tiles), cut the baseshader definition from the end of the .shader file and paste it into the very beginning–make the baseshader the first shader defined in your .shader file. Also, make sure you have the latest ET templates… the first set of ET templates for EasyGen were incomplete. The newest ones are available here.


(StormShadow) #3

Ok, thanks a lot for the help so far… but now, the textures are tiny and they look paneled. Any suggestions on how to fix that?


(chavo_one) #4

Have you added your shader to shaderlist.txt? If you have, make sure you don’t have any small values for “tcmod scale” or “q3map_tcgen ivector”.


(rgoer) #5

Are you sure that the baseshader is listed before the shaders that call it? That was the big thing that was giving me the paneled tex bug. Do you have conflicting tcGen ivector/tcMod scale lines? How about just listing your terrain shader here and we’ll see what we can do with it? Here’s how a working terrain shader could look:

textures/your_map/terrain_base
{
	nopicmips
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

textures/your_map/terrain_0
{
	q3map_baseshader textures/your_map/terrain_base
	qer_editorimage textures/your_map/first_image.jpg
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/your_map/first_image.jpg
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/your_map/terrain_1
{
	q3map_baseshader textures/your_map/terrain_base
	qer_editorimage textures/your_map/second_image.jpg
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/your_map/second_image.jpg
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/your_map/terrain_0to1
{
	q3map_baseshader textures/your_map/terrain_base
	qer_editorimage textures/your_map/first_image.jpg
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/your_map/first_image.jpg
	}
	{
		map textures/your_map/second_image.jpg
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

(StormShadow) #6

Yeah, i moved the base to the top of the script. Do i need to add terrain shaders to shaderlist.txt? Ill try tomorrow…

Here is the shader:

textures/stalin_egn_lower/terrain_base
{
	nopicmips
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

textures/stalin_egn_lower/terrain_0
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/mxsnow3.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/mxsnow3.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/stalin_egn_lower/terrain_1
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/snow_muddy.jpg
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/snow_muddy.jpg
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/stalin_egn_lower/terrain_2
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/s_dirt_m03i_2_big.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/s_dirt_m03i_2_big.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/stalin_egn_lower/terrain_0to1
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/mxsnow3.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/mxsnow3.tga
	}
	{
		map textures/stalin_terrain/snow_muddy.jpg
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/stalin_egn_lower/terrain_0to2
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/mxsnow3.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/mxsnow3.tga
	}
	{
		map textures/stalin_terrain/s_dirt_m03i_2_big.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/stalin_egn_lower/terrain_1to2
{
	q3map_baseshader textures/stalin_egn_lower/terrain_base
	qer_editorimage textures/stalin_terrain/snow_muddy.jpg
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/stalin_terrain/snow_muddy.jpg
	}
	{
		map textures/stalin_terrain/s_dirt_m03i_2_big.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

(rgoer) #7

Yes, you absolutely need to have your terrain .shader listed in shaderlist.txt.


(StormShadow) #8

God, im an idiot. Lol.

For some reason i didnt think adding it to the shaderlist was necesarry (i seem to recall it working fine in previous tests without adding it…). Now i feel like a complete jackass.

Works great now, thanks for taking the time to help :slight_smile:


(chavo_one) #9

A good rule of thumb:

If you want the compiler to know about your shader, it must be listed in shaderlist.txt.

Since texture scaling on terrain is generally done at compile time (with q3map_tcGen ivector), q3map2 has to be able to find the shader. Otherwise, the terrain will be scaled very small. :wink:


(rgoer) #10

Anything with the q3map_ prefix needs to be seen by the compiler (as opposed to just the engine). So when you compile a map, any shader that uses any q3map_ lines in its definition will fail if q3map (or q3map2) can’t find the proper shader in shaderlist.txt.

Oh, and by the way: you might want to go change some of those surfaceparms for your terrain… grasssteps on snow might sound funny?