q3map_lightmapMergable problem


(narc) #1

hello i have a problem where if i use that q3map_lightmapMergable command, the lightmap of my lightmapped terrain becomes entirely black. is there a working example shader of how to use this?

another question i have is: can phong shading be used on a lightmapped terrain, or does it require vertex only methods?


(Shaderman) #2

Doesn’t Easygen create (base)shaders with q3map_lightmapMergable? Maybe a starting point :slight_smile:


(narc) #3

no it doesnt have that keyword in the easygen created shaders, but my shader is a very simple one layer shader. its just this here and there isnt a “base shader” for it, but i dont think its required. – do you spot any mistakes?


//lightmapped snow
textures/narc/snow_0
{
	q3map_lightmapsamplesize 256
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	q3map_texturesize 512 512
	q3map_lightmapsampleoffset 4.0
	q3map_lightmapaxis z
	q3map_lightmapMergable //causes terrain to have solid black lightmap
	q3map_nonplanar //enables phong, no noticable effect
	q3map_shadeAngle 160
	q3map_material Snow
	q3map_lightimage textures/kamchatka/snow_1.tga
	surfaceparm	nomarks
	{
		map textures/kamchatka/snow_1.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}


(Detoeni) #4

q3map_lightmapSampleSize N

Surfaces using a shader with this option will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default Quake III lightmap sample size is 16.

whats “q3map_material Snow”? I’v not seen that one befor.
edit: I googled, no worries


(narc) #5

q3map_lightmapSampleSize was raised because there arent any detailed objects to cast shadow on the terrain and it speeds the compile time. the lower sample sizes dont solve the trouble, nor does adjusting the q3map_lightmapsampleoffset. i wonder if the feature is broken. – phong doesnt seem to work on lightmapped terrain either but i have got it to work elsewhere.


(obsidian) #6

What game are you mapping for? Lightmap mergable may or may not work depending on the game that you are mapping for. It was really only designed to work with ET with support for larger lightmap texture dimensions. Most other games don’t support it.

Don’t use q3map_textureSize. It was designed for RTCW on consoles only, not for PC.

Don’t use lightmapSampleOffset unless you are getting ugly lightmap splotches on terrain. It’s more or less a last resort when filtering and other tricks don’t work.

q3map_nonPlanar doesn’t enable phong shading per se, though it’s generally used on terrain. q3map_shadeAngle enables phong shading. shadeAngle was designed to work for lightmaps.

A q3map_lightmapSampleSize of 256 is relatively large. The default value is 16. If you’re not noticing smoothing effects, it could very well be that you’re not noticing the change with such a low resolution lightmap.