Algorithms for Real-Time Multi-Layered Colored Shadows

Started by
11 comments, last by L. Spiro 12 years, 6 months ago
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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement
I think Humus did something similar.
Check out the "Transparent Shadowmapping" demo here: http://www.humus.name/index.php?page=3D&&start=48
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.
Perhaps I have never been able to find any papers because there are none? Plus this is something I have never seen in games. Only in tech demos such as those by pureLight Technologies to show off their “$50,000 technique”. I have never seen it used in a game. Is it not really as efficient as they claim?


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

What does it mean, that "glass panes are shadowed correctly"? Do they also receive colored shadows - i.e. the red pane receiveing blue shadow? In that case I would be very interested in your algorithm.

I have done colored shadows for my experimental render engine - but only for opaque objects. Called it "density" map.
Basically, while creating shadow map for a light I first render all opaque objects into shadow buffer. Then I'll render all translucent objects into color buffer using compare mode GL_LESS and blending mode - hmmm, do not remember exacly :-/
In shadow pass I'll use shadow map to calculate the presence/absence of light and if present, then density map to calculate the color of light. But I do not see any possibility to apply colored shadows to translucent objects without using depth peeling or such.
Actually I was more interested in giving soft shadows to hair, smoke and similar things than simulating colored glass.
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/
Morgan McGuire has worked on this topic, taking advantage of stochastic techniques. For example, see: http://graphics.cs.williams.edu/papers/CSSM/

What does it mean, that "glass panes are shadowed correctly"? Do they also receive colored shadows - i.e. the red pane receiveing blue shadow? In that case I would be very interested in your algorithm.

Yes.



Morgan McGuire has worked on this topic, taking advantage of stochastic techniques. For example, see: http://graphics.cs.w...du/papers/CSSM/

These are basically the results my technique provides (including volumetric fog lighting), but looking at his CSSM2 description, my method should be faster. Hard to say without testing his method next to mine, but on an average case mine should be doing less work.
In his examples I also see only one light per scene. I wonder if that is a limitation or just his choice for demonstrations.


From the sounds of it so far I will have some documenting to do.
If my technique is new, do I get to name it?


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

I don't have any experience with this area but I just wanted to chime in and say your work sounds really interesting. I think that real time coloured shadows are an under-researched area so it would be great to see some more work in this field.

I'll also point out that there were coloured shadows in Starcraft 2. See this document (http://developer.amd.com/gpu_assets/S2008-Filion-McNaughton-StarCraftII.pdf) from page 50.

If my technique is new, do I get to name it?


If it is new enough, and if you publish an article for people to reference (even if it is just online) there is a good chance that whatever name you choose will stick.

I'll look forward to hearing more about it :-)
I am eager to publish an article, but I want to make some solid demos first and make sure I have all the kinks worked out.
I think I will have something published in about a month.

I hope this will be a common feature in all game engines in the future, because the overhead is minimal in both deferred and forward rendering, and a more expensive version can be used as a fallback for older hardware (or they could just fall back to one of the existing shadowing methods).


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

When you finish the article make sure to post it in this forum!! I'm really interested in reading it :)

(Maybe you can even PM me with the link :rolleyes:)
Sorry to throw a curveball in here, but I would be interested to know what colour you think shadows actually are.
If I take white light and I pass this through a red filter onto a ball, what colour shadow does this ball produce.

This topic is closed to new replies.

Advertisement