# Algorithms for Real-Time Multi-Layered Colored Shadows

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

## Recommended Posts

I have created an “algorithm” for efficient real-time colored shadows which correctly handles layers of colored translucent objects (without the need for compute shaders).
For example, a ball is under a red pane of glass and a blue one. Its shadow is purple. The ball moves through the red pane, and the parts of it above the red pane are shadowed blue and the parts below still shadowed purple. And so on for any number of layers of glass.
The glass panes themselves are also shadowed correctly.

Content, I began watching movies and eating.

Then I thought, “Maybe someone else has made an algorithm for this. And maybe it is better than mine. And maybe it- Oh, watch out Captain Picard!”

The whole reason I invented my way was because I have never seen any research on how to do this for real-time graphics. Every paper I find is for offline rendering and CG software.
I know real-time algorithms exist because I see it in Leadwerks. But according to their site they had to team up with pureLight Technologies, which is a company specializing only in lighting effects etc.
Given that my method takes an evening to code out of any existing standard shadow mapping routine, I doubt we are using the same method.

So I wanted to compare my method to some existing implementations.
Anyone know of any?

If my method turns out to be the most efficient method, I will document it.
If my method turns out to be crap, I will document it. And then not use it.

L. Spiro

##### Share on other sites
I think Humus did something similar.
Check out the "Transparent Shadowmapping" demo here: http://www.humus.name/index.php?page=3D&&start=48

##### Share on other sites
Yes, that is the standard way a lot of engines are doing it.
The problem with that method occurs when translucent objects are overlapping from the light’s point of view.
In my above example, by using that method, the ball will remain purple even while it is between the red and blue panes.

My method eliminates that artifact, and changes the color of the shadow on the ball while it is between the panes of glass.

I play Monday Night Combat which uses Unreal Engine 3 and I recall somewhere reading about Monday Night Combat where it made a mention that glass does not cast shadows on glass, as a limitation of Unreal Engine 3.
Maybe their latest release does, but apparently this has not been such a simple thing to support until now.

• 11
• 15
• 21
• 26
• 11