Jump to content
  • Advertisement
Sign in to follow this  
midime

Deferred Rendering + Lightmaps?

This topic is 2910 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
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.

Share this post


Link to post
Share on other sites
OMFG,

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!