Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7621809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:17:21+00:00 2026-05-31T04:17:21+00:00

As I understand it, shadow-mapping is done by rendering the scene from the perspective

  • 0

As I understand it, shadow-mapping is done by rendering the scene from the perspective of the light to create a depth map. Then you re-render the scene from the POV of the camera, and for each point (fragment in GLSL) in the scene you calculate the distance from there to the light source; if it matches what you have in your shadow map, then it’s in the light, otherwise it’s in the shadow.

I was just reading through this tutorial to get an idea of how how to do shadow mapping with a point/omnidirectional light.

Under section 12.2.2 it says:

We use a single shadow map for all light sources

And then under 12.3.6 it says:

1) Calculate the squared distance from the current pixel to the light source.
…
4) Compare the calculated distance value with the fetched shadow map value to determine whether or not we’re in shadow.

Which is roughly what I stated above.

What I don’t get is if we’ve baked all our lights into one shadow map, then which light do we need to compare the distance to? The distance baked into the map shouldn’t correspond to anything, because it’s a blend of all the lights, isn’t it?

I’m sure I’m missing something, but hopefully someone can explain this to me.


Also, if we are using a single shadow map, how do we blend it for all the light sources?

For a single light source the shadow map just stores the distance of the closest object to the light (i.e., a depth map), but for multiple light sources, what would it contain?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:17:22+00:00Added an answer on May 31, 2026 at 4:17 am

    You’ve cut the sentence short prematurely:

    We use a single shadow map for all light sources, creating an image
    with multipass rendering and performing one pass for each light
    source.

    So the shadow map contains the data for a single light source at a time but they use only one map because they render only one light at a time.

    I think this flows into your second question — light is additive so you combine the results from multiple lights simply by adding them together. In GPU Gems’ case, they add together directly in the frame buffer, no doubt because of the relatively limited number of storage texture samplers available on GPUs at the time. Nowadays you probably want to do a combination of combining in the frame buffer and directly in the fragment shader.

    You also generally apply the test of “pixel is lit if it’s less than or equal to the distance in the shadow buffer plus a little bit” rather than exactly equal, due to floating point rounding error accumulation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement webgl shadow mapping from an example code that already implements
I understand the main function of the lock key word from MSDN lock Statement
Here is an example of what I'm trying to accomplish. The box-shadow from the
So I've read this article and from what I understand, each native browser widget
I'm trying to understand how does Linux encrypt our password on the etc/shadow file,
understand that in App.Xaml.cs, I can create global variable and properties. How do I
I understand how I can change the dns settings for my domains by editing
I understand what System.WeakReference does, but what I can't seem to grasp is a
I understand how JS is run and I think I understand most of the
I understand that some countries have laws regarding website accessibility. In general, what are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.