Sign in to follow this  

Deferred Rendering + Lightmaps?

This topic is 2548 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 2548 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this