Using depth shadows screws up layers

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Max98
Gnoblar
Posts: 11
Joined: Sun Feb 22, 2015 1:10 pm

Using depth shadows screws up layers

Post by Max98 » Thu Aug 06, 2015 10:36 am

So I've been working around to get PSSM Shadows to work in 1.8.1 and I got them working. Now the problem is that when enabling them, the layers get screwed up.

Image
Image
0 x

scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 2

Re: Using depth shadows screws up layers

Post by scrawl » Thu Aug 06, 2015 2:36 pm

By layers, you mean terrain texture layers?

The built-in Ogre terrain material has a limit on the number of layers supported. This limit comes from the maximum number of texturing units you can use in a single render pass. Ogre currently hardcodes this limit as 16 texture units (some GPUs support more, but not all do).
If you do enable (PSSM) shadows, extra texturing units are required to sample the shadow maps, thus you don't get as many layers available. You also need texture units for normal maps.

There are ways around this limit, such as rendering the terrain in multiple passes. Which I've done in the past, as you can see here. It's a bit complicated though.
0 x

Post Reply