Dark line on Lightmap 2.5.14 >


(Hewster) #1

Hi,

I’ve been experiencing strong dark lines in lightmaps since version 2.5.14, and all
dev releases I have tried of 2.5.15:

This pic is of an .ase model with dotproduct2 blending:

This pic shows a very similar borkage on a lightmapped terrain:

Up till now i’ve been manually editing the effected lightmaps, which
is fine, but a fix whould be nice :slight_smile:
This next pic shows the lightmap from the above map:
(note the red is just to point out where the borkage is)

Hewster


(Gringo Starr) #2

I hope I don’t psyche you out by replying without an answer :). That first one looks pretty good! In the second shot, maybe those shadows are a result of how the terrain is cut? Is the tunnel underneath made of the terrain brushes? If they are, I might seperate them entirely from it (ie make all terrain brushes caulk except for the top of course) :slight_smile:


(ydnar) #3

Are they ASE models or brush terrain?

If they’re a model, make sure you don’t have q3map_lightmapAxis z. This forces lightmap projection from top-down, which doesn’t work on vertical or inverted surfaces.

Otherwise, try adding this to the shader:

q3map_lightmapSampleOffset 8

(or 16)

y


(Hewster) #4

The first pic is an .ase model, I did have q3map_lightmapAxis Y in the shader, (and q3map_lightmapSampleOffset)
I removed the q3map_lightmapAxis Y, and it has got rid of the problem (I should also correct myself in that this
was an issue when using 2.5.12 too)… thank-you :slight_smile:
I though I had to specify the direction of the lightmap to match the direction of the
dotproduct2 blend, but obviously I was wrong… lol
Talking of dot_product2, it seems broken in 2.5.15, I’m not getting any blending at all,
is this a known issue ?

FYI, here is a pic of the model in max:

here are the shaders used on this model:

// green in max
textures/ww_mine/terrain_blendZ
{
 qer_editorimage textures/ww_mine/terrain_sand1.tga
 q3map_lightImage textures/ww_mine/terrain_sand1.tga
 q3map_normalimage textures/ww_mine/terrain_rock3_bump.tga
 q3map_forceMeta
 q3map_nonplanar
 q3map_shadeAngle 179
// q3map_lightmapAxis z
 q3map_tcGen ivector ( 320 0 0 ) ( 0 320 0 )
 q3map_tcMod rotate 33
 q3map_alphaMod dotproduct2 ( 0 0 0.97 )
 q3map_lightmapSampleSize 6
 q3map_lightmapSampleOffset 35
 q3map_splotchfix
 q3map_globalTexture
 surfaceparm gravelsteps
 {
  map textures/ww_mine/terrain_rock3.tga
  rgbGen identity
 }
 {
  map textures/ww_mine/terrain_sand1.tga
  blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
  alphaFunc GE128
  rgbGen identity
  alphaGen vertex
 }
 {
  map $lightmap
  blendFunc GL_DST_COLOR GL_ZERO
  rgbGen identity
 }
}


//red in max
textures/ww_mine/terrain_blendY
{
 qer_editorimage textures/ww_mine/terrain_sand1.tga
 q3map_lightImage textures/ww_mine/terrain_sand1.tga
 q3map_forceMeta
 q3map_nonplanar
 q3map_shadeAngle 179
// q3map_lightmapAxis y
 q3map_tcMod rotate 100
 q3map_tcGen ivector ( 320 0 0 ) ( 0 320 0 )
 q3map_alphaMod dotproduct2 ( 0 0.9 0 )
// q3map_clipModel
 q3map_lightmapSampleSize 6
 q3map_lightmapSampleOffset 35
 q3map_splotchfix
 q3map_globalTexture
 surfaceparm gravelsteps
 {
  map textures/ww_mine/terrain_rock3.tga
  rgbGen identity
 }
 {
  map textures/ww_mine/terrain_sand1.tga
  blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
  alphaFunc GE128
  rgbGen identity
  alphaGen vertex
 }
 {
  map $lightmap
  blendFunc GL_DST_COLOR GL_ZERO
  rgbGen identity
 }
}
// blue in max
textures/ww_mine/terrain_blendX
{
 qer_editorimage textures/ww_mine/terrain_sand1.tga
 q3map_lightImage textures/ww_mine/terrain_sand1.tga
 q3map_forceMeta
 q3map_nonplanar
 q3map_shadeAngle 179
// q3map_lightmapAxis x
 q3map_tcGen ivector ( 320 0 0 ) ( 0 320 0 )
 q3map_alphaMod dotproduct2 ( 0.9 0 0 )
 q3map_lightmapSampleSize 6
 q3map_lightmapSampleOffset 35
 q3map_splotchfix
 q3map_globalTexture
 surfaceparm gravelsteps
 {
  map textures/ww_mine/terrain_rock3.tga
  rgbGen identity
 }
 {
  map textures/ww_mine/terrain_sand1.tga
  blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
  alphaFunc GE128
  rgbGen identity
  alphaGen vertex
 }
 {
  map $lightmap
  blendFunc GL_DST_COLOR GL_ZERO
  rgbGen identity
 }
}

I have now been able to reduce the q3map_lightmapSampleOffset 35 to 10, and
remove the splotchfix :smiley: (I was having trouble getting rid of nasty dark marks all over the terrain)
Note to self: don’t use q3map_lightmapAxis !!

The second pic is brush terrain, it doesn’t have q3map_lightmapAxis z,
and I haven’t tried q3map_lightmapSampleOffset yet…
(This problem defiantly started in 2.5.14)
The terrain shader:

textures/ww_town/terrain_base
{
 q3map_lightmapsamplesize 16
 q3map_texturesize 512 512
 q3map_tcGen ivector ( 300 0 0 ) ( 0 300 0 )
 q3map_lightmapGamma 1
 q3map_bounce 1.0
// q3map_nonplanar 
 q3map_shadeAngle 120
}

textures/ww_town/terrain_0
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground01.tga
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_1
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground02.tga
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_2
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/town_rock02.tga
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_3
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/town_rock01.tga
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_0to1
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground01.tga
 }
 {
  map textures/ww_town/ground/kb_ground02.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_0to2
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground01.tga
 }
 {
  map textures/ww_town/ground/town_rock02.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_0to3
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground01.tga
 }
 {
  map textures/ww_town/ground/town_rock01.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_1to2
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground02.tga
 }
 {
  map textures/ww_town/ground/town_rock02.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_1to3
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/kb_ground02.tga
 }
 {
  map textures/ww_town/ground/town_rock01.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

textures/ww_town/terrain_2to3
{
 q3map_baseshader textures/ww_town/terrain_base
 surfaceparm gravelsteps
 {
  map textures/ww_town/ground/town_rock02.tga
 }
 {
  map textures/ww_town/ground/town_rock01.tga
  alphaGen vertex
  blendFunc blend
 }
 {
  map $lightmap
  blendFunc filter
  tcGen lightmap
 }
}

Hewster


(Gringo Starr) #5

Are you compiling with the -shade option? I don’t know if it makes a difference but it then says phong shading is enabled in the Q3map2 output.


(ydnar) #6

Make sure you’re using a recent (from the past day or so) version of 2.5.15, with the ASE model vertex-alpha fix.

y


(Hewster) #7

ok, just done some preliminary tests with 2.5.15, and all seems to be fixed…
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8916

Thanks again Ydnar :slight_smile:

Hewster


(ratty redemption) #8

cool that you got that fixed guys :slight_smile:

and is there a limit to how many units q3map_lightmapsampleoffset will work? I normally dont use more then 16 max, but Id like to know if it gets capped?