Real-Time Shadows in Augmented Reality
This is the title on the semester project I did last semester (7th) as a Medialogy student.
The idea behind the semester project was to look into generating shadows for Augmented Reality, as we hadn’t seen shadows implemented in many frameworks for Augmented Reality.
We looked into creating projection shadows, shadow maps and shadow volumes for ARToolkit.
As the project evolved, we became more and more interested in updating the positions for the shadows in real time, so the shadows aren’t static. As the shadows themselves were not important for this, we implemented projected shadows (as they were the fastest to implement), and focussed on a way for finding light in the environment and create shadows based on this.
Based on prior research, we created a reflective sphere to collect light in the environment and used math to calculate an environment map of the scene.
From this, we used median cut [gl.ict.usc.edu] (which is usually used for HDR environment maps), and created light sources and direction based on this. From there it was just using OpenGL lights and our created projected shadows.
Image of the final implementation:
The paper is available for download here [jbmadsen.com].
A video of the implementation has been uploaded to youtube and can be seen here [youtube.com].





Hi,
i’m very interested with your project, shadow in AR.
Can u share a code that i can try to run it…
i’m very appreciate if u can share with me..tq
Sure.. here’s the link.
thanks..:)
may i know, what the size of reflective sphere u used in ur research..?
It was a normal table-tennis ball painted glossy black, so roughly 38-40mm in diameter.
when did you do this research?
Fall 2009, September to December.
Hi Jacob,
I’m already run your code and it looks interesting.I’m really satisfied.
But, there are some parts that i not really understand..If you don’t mind, i really hope that you can share the documentation/ thesis with me.
I really appreciate your help…tq
thanks..i already received ur attachment in my email…
No problem.
If there are any questions feel free to contact me.
And I hope you will keep me updated with your research. It would be fun to see what comes out of it
hi, jacob. i want to know that every shadow must be draw on a plane or a model, how did you hide them to make shadow looks like on real scene?
The shadows in this project is just projected shadows, which are drawn on the base plane. The base plane itself is just the point of origin and the normal vector up. There is no geometry plane needed for drawing the shadows… not using this method.
Hope that clarifies it
thank you very much, jacob. because i am using artoolkit and osgart, the osg can generating shadow map shadow, and i want to hide the base plane, any ideas?
I haven’t tried that, but I read a paper about a year ago, “Image Based Shadowing in Real-Time Augmented Reality” by Peter Supan. They used a principle similar to this one, and they used shadow maps as far as I remember.
I think they used the shadow map information and subtracted it from the camera feed, then rendered only the objects on top that they wanted rendered. (It was a bit more complex then that, but I bet the paper explains it better).
And here is a quick link:
http://academic.research.microsoft.com/Paper/2518565.aspx?viewType=1
thanks a ton, jacob. i’ll have to look at it:)
Dear Jacob,
Thank you for sharing your knowledge. I am really interested in this area. I need to have shadow on other objects in AR. I mean shadow volume or shadow mapping. Can you help me to do this or guide me what can I do? I have problem with assembling the codes. I have shadow mapping code and shadow volume code but it is difficult to merge them for me.
Your cooperation is highly appreciated.
Hoshang