Shadow Detection

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
willoughbylb
Posts: 1
Joined: Fri Feb 21, 2014 11:33 am

Shadow Detection

Post by willoughbylb »

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
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Shadow Detection

Post by mikkis »

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 ).
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Shadow Detection

Post by mongoose7 »

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?
Post Reply