Texture alignment issues on rtcw terrain map...


(stil) #1

I’ve run into nasty problem with a recent map.

http://www.angelfire.com/indie/stil/pics.html (pics here)

These lines around the texture seems are visible over the whole terrain map.
I built the terrain using Easy-gen, and the shader is water tight afaik. (added q3map_globaltexture, which was I was told might fix the prob)

I originally compiled the map with q3map 2.5, and then I rolled back to 2.3.38 to see if that would help at all… no luck there though. :expressionless:


(ydnar) #2

Read the file lmt.txt included with Q3Map2. It explains how Q3Map2 terrain works (lightmapped or vertex-lit).

Q3Map2-aware terrain shaders use q3map_tcGen to set texture coordinates explicitly, without the use of per-stage tcMods. The resulting shader renders faster.

y


(stil) #3

Ahh, yeah, I already knew those things written in lmt.txt :slight_smile:
I made sure that easy-gen exported a q3map meta-shader, as opposed to the standard id version. q3map_terrain is already in the common/terrain(2) shaders, and I’ve changed the maps world spawn flags to _indexmap _shader _layers …etc

The version of the map, in the pics, was built without lighting. The same results are achieved with lighting (the map is lit properly, but the texture errors remain)


example of my terrain shader

"
textures/pacific/terrain_0
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/stone/mxsand2.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}
"

"textures/pacific/terrain_0to1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )

{
	map textures/stone/mxsand2.jpg
}
{
	map textures/assault_rock/ground_c07a.jpg
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
}

}
"


(ydnar) #4

Do all the shaders have identical q3map_tcGen parameters?

A cleaner way to go about it is to make a base shader with the tcGen stuff built in, then use q3map_baseshader in the rest of them to inherit its properties:

textures/pacific/terrain_base
{
q3map_lightmapAxis z
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

Note: The texture size and lightmap sample size directives aren’t really necessary.

y


(demonspawn) #5

Ydnar, I think there may be more to this terrain issue than just shader errors, unless you can see where i’ve made an error with mine :smiley:

I have experienced this problem with my latest map and from what I’ve been told many others are also experiencing it.

Here is what is happening to me.

The pink dashed line is where the shader isn’t displaying the meta shader information correctly

The green area is what the terrain should look like and where the grass texture should be.

This “hard edged” texture transition is also sporatically happening all over my map…some areas more obvious than others.

I have made my shader with a baseterrain.

textures/dg_aztek/baseterrain
{
q3map_lightmapsampleoffset 8.0
q3map_lightmapaxis z
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
surfaceparm grasssteps
q3map_globaltexture
}

and have made all the stages as follows

textures/dg_aztek/terrain_0
{
q3map_baseshader textures/dg_aztek/baseterrain
q3map_lightimage textures/stone/mxrock3_a.tga

{
	map textures/stone/mxrock3_a.tga
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
	rgbGen identity
}

}

textures/dg_aztek/terrain_0to1
{
q3map_baseshader textures/dg_aztek/baseterrain
q3map_lightimage textures/stone/mxrock3_a.tga

{
	map textures/stone/mxrock3_a.tga
}
{
	map textures/stone/ground_c09a.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
}

}

and the final stage

textures/dg_aztek/terrain.vertex
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
q3map_globaltexture

{
	map textures/stone/mxrock3_a.tga
	rgbGen vertex
}

}

now the only question I have with the shader is should this final stage be this

textures/dg_aztek/terrain.vx

as I have seen on some posts here?

I was told that it might be a flat tri somewhere on my terrain that is causing this but I have removed all flat tri’s and it is still happening.

I hope I have given enough information about this to help me fix the problem, the addition of lightmapped terrain and bumpmapped textures and patch shadows has greatly increased the visual quality of my maps and I thank you for all your hard efforts…if you could help me solve this final issue I will be eternally in your debt… :drink:


(ydnar) #6

Get the 2.5.5 test build from Shaderlab. It fixes a long-standing bug with alphaMap sampling that’s been there since Team Arena q3map. Don’t know why I didn’t fix it earlier.

You should rename the shader to terrain_vx. Arbitrary ‘.’ characters in a shader name causes things to think it’s a suffix (like .tga) and get stripped.

Not to mention RTCW doesn’t have any of the terrain remap key support anyway, so it’s a moot point…

y


(demonspawn) #7

Great…thanks for the info and quick response… :beer:

Edit
:clap: You da man Ydnar…problem gone…tks :drink: