Skip to content

How do we produce shadows? #29

@cuppajoeman

Description

@cuppajoeman

Hi, I’m pretty new to this style of lightmapping, so I’m trying to understand how shadows are intended to be produced with this library.

A good reference is the demo image here:

https://github.com/ands/lightmapper/raw/master/example_images/gazebo_shadows_reflections.png

Suppose I have a basic OpenGL renderer using Blinn-Phong lighting with a single spotlight.

From what I understand, there are two possible ways to use the lightmapper:

  1. The renderer already computes direct lighting and shadows, for example with shadow maps. In that case, the first lightmapping pass would mainly capture indirect lighting / bounce lighting.

  2. The renderer does not compute shadows itself. In that case, the first lightmapping pass would need to compute the initial direct lighting and shadows.

My current understanding is that option 2 seems preferable, because the lightmapper can produce cleaner baked shadows than a real-time shadow map, which may have jagged or blurry edges.

However, I’m confused about how the direct light source should be represented during the lightmapping pass.

For example, with a physical area light, I can understand how the light exists in the scene and contributes illumination. But for common game-style lights such as directional lights, point lights, and spotlights, the light source usually does not correspond to actual visible geometry in the scene. A point light or spotlight is usually just a mathematical light source with intensity, falloff, direction, and cone cutoff.

I think the fastest way to clear this up if there was an example OpenGL renderer that works with something like gazebo.obj and demonstrates baked shadows from directional, point, or spot lights. If anyone has this, would they be willing to share?

So yeah, I'm pretty much just asking for a minimal example showing how to get nice baked shadows with common game-style light types such as directional lights, point lights, and spotlights.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions