Log in or register to post comments

Casting shadows on marker plane

November 15, 2012 - 9:37am #1

Hi, another idea I was thinking about is casting shadows on marker plane. This would be a bit more tricky to implement, possibly undoable too, but was thinking about following procedure. It's shadow mapping I was thinking about.

  1. For shadow maps to work one should first render depth map from the light point of view. This is the hardest part AFAIK but might be doable using currently available pose- and projection matrices. This would include rendering both marker plane and 3D object into depth buffer.
  2. Render the scene as usual - with the difference there's shadow map available. For casting shadows properly one should also render the marker plane too on which the shadows are most likely cast.

Will give this a go later on once I have time but leaving the idea here for others to see.

Casting shadows on marker plane

August 2, 2016 - 2:43am #9

Good.

Casting shadows on marker plane

November 4, 2015 - 9:34am #8

Thought I'd bump this thread since it seems shaders that allow transparent objects to recieve shadows are much in demand.

Anybody have any pointers as to how this might be achieved?

Casting shadows on marker plane

September 22, 2014 - 12:14am #7

can you prove a project demo or example?thanks!

Casting shadows on marker plane

January 27, 2014 - 12:59pm #6

You may download the file for your project

TANKS...

Casting shadows on marker plane

November 19, 2012 - 12:59am #5

Very nice work!

Casting shadows on marker plane

November 17, 2012 - 10:48am #4

Hi, I added a video on Youtube showing the shadows using shadow maps (sorry foor poor video quality);

http://www.youtube.com/watch?v=qRAv1FDtJC0

What I learned is that I had false assumptions earlier before I started to implement this.

  1. Shadow map is very easy to generate if you keep your light position in model space. All you have to do is choose a light position and generate view (usually a lookAt positioned at light position plus directed towards origo) and projection (basic perspective projection is ok) matrices. Then you need to render only the object into depth map, no need to render the marker plane as I thought earlier.
  2. In my implementation I used only a fixed size rectangle as surface shadows are cast on. This surface is aligned along with marker plane having top-left coordinate (-100, 100, 0) and bottom-right coordinate (100, -100, 0). Meaning no self shadowing for objects yet but it should be doable too. And given the light view and projection matrices I used for shadow map generation - same matrices are used to map shadow map texture coordinates for rendering the shadows.

It's a bit hard to explain the whole procedure in a meaningful way but I do hope that Vuforia team comes to resque one day and provides better explanation on the technique. Assuming there are interested parties that is.

Casting shadows on marker plane

November 16, 2012 - 3:32am #3

Hi, shadow mapping is a very cool thing, especially in the AR case;

I encourage you to explore your ideas, and if you then have any sample code to share, feel free. I'm sure this will be useuful to a lot of other developers.

Anyone willing to share code and ideas here is also welcome.

 

Casting shadows on marker plane

November 16, 2012 - 1:37am #2

Here's a few "proof-of-concept" pictures rendered with somewhat similar technique as described in previous post.

http://i.imgur.com/VHktK.png

http://i.imgur.com/ZolcO.png

Second image shows situation in which cube is partly occluded by marker plane.

Log in or register to post comments