lightmapped terrain not showing with r_vertexlightning 1


(ogun) #1

I have the vertexremapshader lines (vertexremapshader9: textures/nsq3_terrain/frenzy_blackrock_2to3;textures/frenzy_blackrock.vertex etc) in worldspawn, but apparently this isn’t enough. This is what the terrain shader looks like:

// ------------
// FRENZY BLACKROCK BASE SHADERS - 4 layer terrain shader used in ns_frenzy
// ------------

textures/nsq3_terrain/frenzy_blackrock_0
// Basic blackrock texture
{
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_0.tga
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_1
// Grassy rocks texture
{
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_1.tga
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_2
// Basic grass texture
{
	surfaceparm dirtsteps
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/jungle_0.tga
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_3
// Basic rock texture
{
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/jungle_2.tga
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}


// ------------
// META SHADERS
// ------------

textures/nsq3_terrain/frenzy_blackrock_0to1
// Blend between ROCKS and GRASSY ROCKS
{
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_0.tga
	}
	{
		map textures/nsq3_terrain/blackrock_1.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_0to2
// Blend between ROCKS and GRASS
{
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_0.tga
	}
	{
		map textures/nsq3_terrain/jungle_0.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_1to2
// Blend between GRASSY ROCKS and GRASS
{
	surfaceparm dirtsteps
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_1.tga
	}
	{
		map textures/nsq3_terrain/jungle_0.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_0to3
{
// Blend between BLACKROCK and ROCKS
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_0.tga
	}
	{
		map textures/nsq3_terrain/jungle_2.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_1to3
{
// Blend between GRASSY ROCKS and ROCKS
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/blackrock_1.tga
	}
	{
		map textures/nsq3_terrain/jungle_2.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

textures/nsq3_terrain/frenzy_blackrock_2to3
{
// Blend between ROCKS and GRASS
	q3map_lightmapsamplesize 12
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	
	{
		map textures/nsq3_terrain/jungle_0.tga
	}
	{
		map textures/nsq3_terrain/jungle_2.tga
		blendFunc gl_src_alpha gl_one_minus_src_alpha
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc gl_dst_color gl_zero
	}
}

Does anyone know the problem?


(ydnar) #2

Rename the end of your vertex shader from “.vertex” to “_vx”. The ‘.’ character in shader names is a no-no.

y


(ogun) #3

Ok I will once I get home, tnx!


(cloudscapes) #4

Terrains with crossfading shaders (easygen for example) won’t work because vertex mode only renders one shader pass.


(ogun) #5

Hm what should a vertex terrain shader look like?


(cloudscapes) #6

Like a terrain who’s textures don’t fade into each-other. They just change where the next brush starts. There are three solutions:

  1. Make the terrain like you are now but don’t support vertex users.

  2. Make the terrain without any blends by mapping the textures directly on the brushes. EasyGen didn’t support this itnernally last time I checked (which was months ago) so you’d have to retexture the terrain in Radiant. You’ll then support vertex users.

  3. Make ‘in-between’ textures yourself. Instead of having EasyGen make the blend shader for you between a grass texture and a rock texture, make one yourself in Photoshop or the likes. The advantages is that if you’re a good artist you can make the textures blend together however you want, much better looking than a simple cross-fade. But it’s a lot more work and is a bitch to align properly in Radiant.


(ogun) #7

How about adding something like this to the terrian shader:

textures/nsq3_terrain/frenzy_blackrock_vx
{
	surfaceparm dirtsteps
	{
		map textures/nsq3_terrain/blackrock_1.tga 
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

(ogun) #8

Didn’t q3map2 handle this well automatically before? Skipping meta shaders, just rendering the “clean” shaders of the terrain with vertex lightnign activated.


(ogun) #9

Ok, I removed the vertexremapshader lines in worldspawn and it worked perfectly, as in my other map with terrain. Apparently you should simply let q3map2 handle it all.


(The5thHorsemen) #10

Jesus Christ man I have been pulling my hair out over that one for a month…

and it was the dam worldspawn command lines SOB! :banghead:

I rewrote and renamed everything including my Easy-Gen templet shader’s about 20 time’s redid the texture’s in .tga then in .jpg then back to .tga

and it was the worldspawn command line’s

slap me sideway’s and call me suzie :bash:

well thanks Ogun … I can die in peace now


(ogun) #11

=/
I’m happy it works for you now The5thHorsemen.