PDA

View Full Version : Is it possible to cast a shadow on a transparent ground using shadow mapping



yangpeng
12-11-2014, 11:30 AM
I followed the tutorial below to cast shadow in my OpenGL scene.
www.paulsprojects.net/tutorials/smt/smt.html

But what I want to do is to render a 100% transparent ground while casting shadow on the ground .I have tried to use a 100% transparent png picture as the texture of the ground, but the shadow disappeared too.Is there anyone tell me how to render a transparent ground and cast shadow on that ground using shadow mapping. Best to supply some code.

Alfonse Reinheart
12-11-2014, 11:42 AM
It's not clear what you're intending to do. "100% transparent ground" would be invisible, since you see thing by light reflectance, and 100% transparency means that it reflects no light. Even if the surface emitted light, you still wouldn't see shadows on it (shadows are the absence of reflected light, and a 100% transparent surface has no reflected light).

Perhaps you could describe the scenario you're trying to render using more real-world terminology. Is this a water or glass surface?

yangpeng
12-11-2014, 12:05 PM
It's not clear what you're intending to do. "100% transparent ground" would be invisible, since you see thing by light reflectance, and 100% transparency means that it reflects no light. Even if the surface emitted light, you still wouldn't see shadows on it (shadows are the absence of reflected light, and a 100% transparent surface has no reflected light).

Perhaps you could describe the scenario you're trying to render using more real-world terminology. Is this a water or glass surface?

Thanks for your reply. What I want to implement is an augmented reality scenario with a video background captured by a web camera.
I want to render 3D objects on the video without a 3D ground as if the shadow is cast on the real world(video).
In fact I succeed in casting a shadow on an invisible ground using stencil buffer but I failed to use it in my project as there was a problem I could not solved.
Then I have found the tutorial as I mentioned above and used it in my project.
Now what I want to to is let the ground to be invisible.