Shadow Detection
-
- Posts: 1
- Joined: Fri Feb 21, 2014 11:33 am
Shadow Detection
I am working on a project where we are add improvements to the irrlicht engine as well as creating out own game with these new features. I was wondering how feasible it would be to do some sort of shadow detection. In short i want to create an object that reacts when it is in the light or when it is in the dark. I imaging that there would be some info within the shader that i could us, I am just wonder is this something that 4 guys still in school could get done in a couple weeks
Re: Shadow Detection
Might be hard if using irr's stencil shadows (shadow volumes) but if using XEffects' shadow mapping, then you could modify shader that it renders only shadows to fbo, then check with x,y coordinates is it shadow or not (with opengl, you could use glReadPixels http://stackoverflow.com/questions/6144 ... xel-buffer ).
Re: Shadow Detection
You cannot get information out of a shader. Inspecting the rendered image is probably not a good idea - how would you know where the object is? Also, glReadPixels is slow. What about casting a ray from the object back to the light and see if it intersects any objects?