shadow problem


(Mercenary) #1

I’m getting a bad looking seam along a shadow when I compile. Don’t know what’s causing it.

http://mercenary.bravehost.com/shadow.html

There’s an x-wing md3 and a func_group made of physics_clip above the shadow. The terrain was made with EasyGen. The scene is a sunset. Here’s the sky shader:

textures/crash_site/canyon
{
qer_editorimage textures/skies/sky.tga
q3map_sunExt 0.95 0.99 1.0 275 15 60 2 16
q3map_skyLight 225 3
surfaceparm sky
surfaceparm noimpact
surfaceparm nomarks
notc
q3map_nolightmap
skyParms textures/crash_site/tatooine 512 -
}

I’m using the following compile options:

-meta -vis -light -bounce 4 -dirty - fast -patchshadows -samples 3

Anyone know what’s causing it and how to fix it?


(obsidian) #2

I don’t think this lighting issue has anything to do with your sky shader, but rather with your terrain. Is the surface that the X-wing is sitting on lightmapped?

If so, please post the shader for it.


(Mercenary) #3

I used the q3map2 template in EasyGen for the shader and I added q3map_material sand in some places, here it is:

textures/tatooine_canyon/terrain_0
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )
{
map textures/desert/rockwall2.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tatooine_canyon/terrain_1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_material sand
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )
{
map textures/danger/sanddunes.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tatooine_canyon/terrain_2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_material sand
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )
{
map textures/desert/sandfloor2old.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tatooine_canyon/terrain_0to1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )

{
	map textures/desert/rockwall2.jpg
}
{
	map textures/danger/sanddunes.jpg
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
}

}

textures/tatooine_canyon/terrain_0to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_material sand
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )

{
	map textures/desert/rockwall2.jpg
}
{
	map textures/desert/sandfloor2old.jpg
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
}

}

textures/tatooine_canyon/terrain_1to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 1024 1024
q3map_material sand
q3map_tcGen ivector ( 853 0 0 ) ( 0 853 0 )

{
	map textures/danger/sanddunes.jpg
}
{
	map textures/desert/sandfloor2old.jpg
	alphaGen vertex
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	tcGen lightmap
}

}

textures/tatooine_canyon/terrain.vertex
{
{
map textures/desert/rockwall2.jpg
rgbGen vertex
}
}


(Mercenary) #4

:bump:

anybody?


(ydnar) #5

Remove this line from your terrain shader:

q3map_lightmapsamplesize 64

Also, you might want to edit your terrain shaders to use subclassing via q3map_baseshader. See the file lmt.txt included with Q3Map2.

y


(Mercenary) #6

Thanks a lot man! :rocker2: I removed the line you suggested and added _lightmapscale 0.5 to the terrain and it looks really good. I couldn’t get the shader method you mentioned to work but everything is looking good now so I’m not going to mess around with it any more.

cheers
:drink: