Applying Panda3D's shadow sample

Hello everyone.

I saw the Shadow sample look like a flashlight.
So I wanna apply it to my horror game.

So I attach LCam to my model and I saw the light project to the scence into two sites.
How can I disable the back screen of Lcamera. ( I mean how to disable the second light projection. )

Thanks,
Ola

Sorry, you can’t, at least not without writing a pixel shader, or using some other clever trick like figuring out which part of the scene is in front of the flashlight, and applying the texture only to that part.

Using the classic fixed-function texture projection algorithm, the texture always projects in both directions, to any piece of geometry that the texture is applied to.

Another idea is to tie the flashlight and the camera together so that the camera is always looking roughly in the same direction as the flashlight, so that you never see the back projection.

David

Or you could create a light that makes the back faces of objects black.

Ooh! That’s clever.

David

Thank you very much!!
That is a good trick!! :slight_smile:

Regards,
Ola