Quick shadow question

had another shadow idea,

render scene in dark from lights point of view and give everything a stencil value of 1 on the depth test passing(greater than or equal to) this way only visible stuff is put in the stencil buffer

render scene with lights on and anything without a stencil value,(anything not seen from lights point of point of view is in shadow



your render the scene in darkness and fill in light where needs be

also another idea is you just cull the back faces (from the lights point of view thats anything that isn't seeable then put everything in the stecil buffer regardless of depth pass/fail this way everything seeable from lights point of view again is givin a stencil value.



My only question is how fast is stencil?

You need to look at how shadows are done now, then repost this. You are posting very general concepts that are already being done.

alrite sorry tring to reinvent the wheel again.  Anyways i was working on shadow mapping and was wondering how should I go about rendering from lights point of view, create a camera from renderer (tempCam),

do a for loop to cycle light state using LightState.get(int i) to get a light

set the camera's position/direction from the lights values

then set the renderers camera as the tempCam

and render scene getting what info I need, in this case depth buffer