stencil shadows only on idle time

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
max6666north
Posts: 15
Joined: Fri Jun 03, 2011 9:35 am

stencil shadows only on idle time

Post by max6666north »

Hi folks

because the stencilshadows sometimes are slow (on old computers or
large scenes) i want to enable them only if the program is idle and
switch them off if i move the camera...

for this i need some hints to solve it.

thanks
max
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Unless you have a static camera 90% of the time, doesn't this kind of beat the point of having shadows at all? (not to mention that this would look rather ugly)

You could always set your shadow volume scene nodes as invisible while updating your camera to achieve what you want, might get a bit hard to manage though

EDIT:

To propose a better alternative, I'd suggest you look into shadow mapping and tweak this to your liking; it looks nicer than stencil shadows in general, and you should be able to make them as simple or as complex as you want depending on your performance needs
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, but shadow maps and old computers might be a problem. Moreover, there's no default implementation for them in Irrlicht. Maybe someone could suggest and provide an implementation for inclusion into the engine?!
The suggestion for changing visibility of the shadow nodes is correct, though I'm not sure if it works currently. Shadow nodes are handled slightly special, which means that there might be some issues with the default scene nodes handling. But giving it a try shouldn't hurt. Checking the times when to enable or disable them is up to you, though. There's no way to check for idle times or camera movement in Irrlicht automatically.
max6666north
Posts: 15
Joined: Fri Jun 03, 2011 9:35 am

Post by max6666north »

[quote="Radikalizm"]Unless you have a static camera 90% of the time, doesn't this kind of beat the point of having shadows at all? (not to mention that this would look rather ugly)

You could always set your shadow volume scene nodes as invisible while updating your camera to achieve what you want, might get a bit hard to manage though

EDIT:

To propose a better alternative, I'd suggest you look into shadow mapping and tweak this to your liking; it looks nicer than stencil shadows in general, and you should be able to make them as simple or as complex as you want depending on your performance needs[/quote]

thanks for re

i tried to make the shadow volume scene nodes invisible and it works
in general, but the handling is the problem.
if shadows are on the mouse actions are very slow and the time
until i can switch off the visibility is very long (first click event).
The second is, if i release the mouse (cameramovement stops)
the shadows should come after a specified time....

max
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

hybrid wrote:Yeah, but shadow maps and old computers might be a problem. Moreover, there's no default implementation for them in Irrlicht. Maybe someone could suggest and provide an implementation for inclusion into the engine?!
The suggestion for changing visibility of the shadow nodes is correct, though I'm not sure if it works currently. Shadow nodes are handled slightly special, which means that there might be some issues with the default scene nodes handling. But giving it a try shouldn't hurt. Checking the times when to enable or disable them is up to you, though. There's no way to check for idle times or camera movement in Irrlicht automatically.
Flexible render passes would make the implementation of various shadow mapping techniques much easier I suppose, I haven't had time yet to mess around with shadow maps in irrlicht, although I have some simple implementations in my own engine which I could port (given that they are good enough performance-wise for irrlicht, since my engine does not need to maintain compatibility with older or mobile systems)
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Stencil shadows are done extruding the silouette that creatres a mesh, so, a way to speed them up is to use simpler meshes to create just the shadows, and work with them.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply