Shadow LOD?

Everything related to 3D programming
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Shadow LOD?

Post by Bananenfreak »

Is there a possibility for shadow LOD or is this already implemented?
My Scene (~1.3 Million tris and ~900 entities) is rendered with 60FPS (No shadows). When I enable shadows, FPS drop to ~35.
I don´t want to disable shadows before renderdistance disables all, because this should be realistic and without shadows it´s not that kind of realistic.
Reducing the pixelamount of shadows would be perfect in far distance to Players, because no one sees a difference between Low- and Highpixel shadows in a far distance.

Is there a way to enable this? Materialscript or something else?
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Shadow LOD?

Post by Samuel »

I'm assuming your using modulative or additive shadow types. Which are both stencil shadows.

A couple years back, on the Ogre forums, someone asked for stencil shadow lod. This was Sinbad's reply.
I underlined a few parts.
sinbad wrote: This has been discussed before - the major problem with this idea is that it rules out self-shadowing, because unless the shadow volume matches the visual geometry exactly, there will be artefacts poking through the light cap end (and to some degree on the other side but it's less obvious). You can use backface projection to make this less of an issue, but that only works with certain meshes. Thus, LOD on stencil shadows in general terms normally means splitting shadow casters and shadow receivers and not having self-shadowing. So it's a bit more complex than you're making out.

I don't think it's warranted. Stencil shadows are heavy on geometry & CPU - that isn't going to go away. They're also quite fillrate inefficient. LOD is just one way to mitigate the geometry / CPU issue a bit - it just moves the threshold a bit and doesn't resolve the fillrate issue at all. When it comes down to it, stencil shadows are a technique best reserved for relatively simple scenes, which is precisely why more recent games don't use them. Every new game you'll see these days uses a variant of texture shadows precisely because they aren't CPU / geometry limited and have a much more predictable fillrate overhead. They have issues of their own of course, but on balance they are superior for high detail scenes, and are essential when using shaders which deform geometry. Eihort enhances the texture shadows in Ogre even further so you can use more detailed texture shadows (plane optimal and LiSPSM projection), tighter shader integration, depth shadowmapping and filtering. You would almost certainly be better to address your complexity issues that way than trying to improve stencil shadows, which have mostly had their day.
As for textureadditive shadows there may be a solution, but more research is needed. And even if there is a way I'm guessing we'll need to set up the casters and recievers ourselves. Which isn't possible in Purebasic yet.

To summarize it's not possible as of now and if it ever is possible. It will be limited to texture shadows.
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Shadow LOD?

Post by Bananenfreak »

Yes, I also read those things. I also read that there is no good possibility than set an renderdistance for shadows.

But it would be cool if we could use own shadowcasters and -Receivers, but I don´t have a clue about this and I don´t want set up an thread only with:
"Please make this possible." (Or can I do this?)^^
Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Shadow LOD?

Post by Samuel »

I'd hold off putting in the request for them until we find all the necessary commands and steps.
I've found a few commands, but I want to make sure that I didn't miss any.
I'll try a couple of Ogre's samples to see exactly how they use them.

For the time being what about your mesh LOD?
Shadow volume complexity should decrease as your objects quality decreases. Just make your meshes LOD simple when they are far away.
That should speed things up a bit.
Post Reply