I use terrain blending for a new br map.
I use standard sg shader like this one :
- Code: Select all
// Dirt to Sand2
textures/sg_blend/dirt_to_sand2
{
q3map_lightimage textures/sg_sand/sand_desert2.tga
qer_editorimage textures/sg_blend/dirt_to_sand.tga
surfaceparm dust
q3map_shadeangle 70
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_lightmapAxis z
{
map textures/sg_sand/sand_desert2.tga
rgbGen identity
}
{
map textures/sg_dirt/dirt_brown3.tga
blendFunc GL_SRc_ALPHA GL_ONE_MINUS_SRc_ALPHA
rgbGen identity
alphaGen oneminusvertex
}
{
map $lightmap
blendFunc GL_DST_cOLOR GL_ZERO
rgbGen identity
tcGen lightmap
}
}
Then I instruct q3map2 to generate 1024x1024 lightmap
- Code: Select all
// Dirt to Sand2
textures/vg_blend/dirt_to_sand2
{
q3map_lightimage textures/sg_sand/sand_desert2.tga
qer_editorimage textures/sg_blend/dirt_to_sand.tga
surfaceparm dust
q3map_shadeangle 70
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_lightmapAxis z
q3map_lightmapSize 1024 1024
q3map_lightmapBrightness 2.0
q3map_lightmapSampleSize 4
q3map_lightmapMergable
{
tcgen lightmap
map $lightmap
rgbGen identity
}
{
map textures/sg_sand/sand_desert2.tga
rgbGen identity
}
{
map textures/sg_dirt/dirt_brown3.tga
blendFunc GL_SRc_ALPHA GL_ONE_MINUS_SRc_ALPHA
rgbGen identity
alphaGen oneminusvertex
}
{
map $lightmap
blendFunc GL_DST_cOLOR GL_ZERO
rgbGen identity
tcGen lightmap
}
}
the lm_000x.tga external images are generated in the map/mymap directory. The q3map2_mymap.shader is generated in the scripts directory, but the image is not used in game and the terrain is fully illuminated (like when not using q3map2 -light phase)
Something is probably missing in the runtime part of the shader, but what ?
Any idea someone ?
Thanks.