NormalMap Lighting Weirdness


(WadeV1589) #1

I was hoping someone could explain why this happens and maybe how to fix it:

As you can see, the same shader sometimes works perfect, sometimes works poorly and sometimes doesn’t really work at all! My shader is as follows:

textures/meier/castlestone1
{
    q3map_lightmapsamplesize 1
    q3map_normalimage textures/meier/castlestone1_normal.tga
    q3map_bounce 0.5
    {
        map textures/common/white.tga
        //map textures/meier/castlestone1.tga
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

(chavo_one) #2

Somebody else can probably give a more informative reply, but it all boils down to the _lightmapscale to wall size ratio.

The bump map looks good on the smaller brush face because the ratio is better. To make the large walls have more detail, you need to make the wall a func_group and lower the _lightmapscale value. (default is 1, try .5, .25, or .125 if you’re desperate)

There have been other posts about playing with _lightmapscale. Just search the forum.


(WadeV1589) #3

That’s something that can’t always be true, in some places a bevel goes onto a regular wall, the bevel is the same size as the wall (width/height), however the bevel has the bump map effect, the wall does not.


(ydnar) #4

Lightmaps are never larger than 128x128. A large wall with a low lightmapscale will probably hit the limit, forcing Q3Map2 to use a larger sample size.

BTW, if you’re using normalmaps, you should probably not use -filter as it blurs the effect. Try using these options:

-light -fast -samples 2 -thresh 0.25

The latter is necessary for high-quality bumpmapping.

y


(Emon) #5

I think splitting up the wall into brushes may fix that problem, as ydnar said lightmaps aren’t over 128x128. I think you’ll have to make it a bogus ent otherwise it’ll be recombined or something. I suppose hint may work, too…


(WadeV1589) #6

I forgot about -thresh 0.25 lol, I added that in and it’s helped it enough to make the lightmap obvious enough now, I just need to make the actual brick texture plainer so the lightmap becomes more obvious.

Thanks for the help!