About directional lightmapping ...

Ask questions about mapping in general, and show off your in-progress work.
Post Reply
Spiney
Dretch
Posts: 30
Joined: Thu Dec 12, 2013 5:35 pm UTC

About directional lightmapping ...

Post by Spiney »

So the game does normal mapping on map geometry by storing the direction of the incoming light.
One of the issues with storing a single light vector is that you have to work with averages when dealing with overlapping lights.
This creates some strange behavior in cases where there's a sudden change in light direction.
It is especially visible for the specular highlights, sometimes the specular might even make the shadow appear brighter than the lit area.
Some examples would be small radius bright lights on some maps for things like wall lights, or a spotlight shining through floorgrates.
There's also potential issues with shadow penumbra where the one dominant lights source fades into another, causing a low-contrast fringe to appear around the light.

I was wondering about ways to avoid or fix this.

  1. Have the ability to mark certain light sources to only contribute to light intensity but not direction. This would need to be supported by the compiler.
  2. Use lightstyles on fail-cases to do a second pass over the world geometry, this would be more expensive and would need compiler support.
  3. Use dynamic lights for certain lights, this would be more expensive.
  4. Blur / Lowpass the lighting directions to hide obvious artifacts.

This is not an issue with the engine, it's a limitation of using light maps to do normal mapping.
Here's an example of the issue in Unity:
http://forum.unity3d.com/threads/direct ... ct.134335/

User avatar
Viech
Project Head
Posts: 2139
Joined: Fri Aug 03, 2012 11:50 pm UTC
Location: Berlin

Re: About directional lightmapping ...

Post by Viech »

You are correct about what you outline but I don't think we have anyone capable of doing this on our team who isn't yet occupied with other stuff. After all, most of this would require vast engine changes to work.

Responsible for: Arch Linux package & torrent distribution, Parpax (map), Chameleon (map texture editor), Sloth (material file generator), gameplay design & programming, artistic direction

Post Reply