Deferred Rendering + Lightmaps?

Started by
1 comment, last by midime 13 years, 3 months ago
Hello,
I have recenttly been playing a very good survival horror title "Amnesia: the dark descent". The most interesting stuff about this game for me was it's graphics and atpmosphere and I came up with one question.

LightMap

This picture show's the thing I can't undestand in amnesias engine - it's how they combined deferred rendering and textured lightmapping. What i can say about this lighmap is that it is definitely some sort of spotlight with a lightmap texture - I have seen it being done in games map editor. But how can program this technique on my own? The main problem when I tried to do this was that when I texture a cone (spotlight) the lighmap depends on a position from which I'm waching the cone (the normal behaviour of a textured object). But it definitely needs to be static from any position I'm watching it. Any ideas?

Waiting for your response,
MidiMe
Advertisement
What you're talking about doesn't sounds like light maps, but rather projective texture. Basically you just author a monochrome texture containing the shape of the shadow you want cast, and then you apply it much like you would a shadow map:

1. Create a view + projection matrix based on the position, direction, and angular attenuation of the spot light

2. When rendering the light in the deferred pass, reconstruct your world or view space position from the depth buffer and apply the lights view * projection to that position to get a texture coordinate

3. Sample the projected texture using the texture coordinate, and use it to modulate the light value. You can also combine this with a shadowmap lookup for dynamic shadows.
OMFG,

MJP you are my helper! Somehow I have never thought that this is just projected texture! Everything worked fine. Thank you alot!

This topic is closed to new replies.

Advertisement