Jump to content
Sign in to follow this  
Kydoimos

Shadow LODs and Shadow Stencils

Recommended Posts

Hi there, guys

 

 

I've been doing as much reading as I can on the different LODs needed for different models and I have a few questions on the theory behind shadow LODS and stencils. Now, I know this has been covered a lot on the forums, but I couldn't find much on why they are important. I've picked up the 'dos' and 'don'ts', such as, shadows must be triangulated, sharp, made from planes, welded, and not textured etc., but I don't really understand how they function. In particular, I don't quite understand how a shadow stencil works and what a shadow LOD does (seeing as generic shadows are created from the model in-game anyway). I have noticed that 'banding' occurs on textures without a shadow LOD, however.  

 

With shadow stencils, how should these be arranged on a model? Obviously, in-game, the light is in different places at different times. Also, on a related subject, it's been suggested that I use more than one view LOD on a model. What exactly is a view LOD in a generic sense? A duplication of a model which appears at a different distance? If this is correct, what should the differences be from one view LOD up close to one that is farther away?

 

If I've missed some good tutorials, my apologies! :D I might try and put one together when I understand a bit more!

 

PS: Cheers all, who've been very patiently and politely helping me with the modelling on these forums - you know who you are!

Share this post


Link to post
Share on other sites

Hi there, guys

 

 

I've been doing as much reading as I can on the different LODs needed for different models and I have a few questions on the theory behind shadow LODS and stencils. Now, I know this has been covered a lot on the forums, but I couldn't find much on why they are important. I've picked up the 'dos' and 'don'ts', such as, shadows must be triangulated, sharp, made from planes, welded, and not textured etc., but I don't really understand how they function. In particular, I don't quite understand how a shadow stencil works and what a shadow LOD does (seeing as generic shadows are created from the model in-game anyway). I have noticed that 'banding' occurs on textures without a shadow LOD, however.  

 

With shadow stencils, how should these be arranged on a model? Obviously, in-game, the light is in different places at different times. Also, on a related subject, it's been suggested that I use more than one view LOD on a model. What exactly is a view LOD in a generic sense? A duplication of a model which appears at a different distance? If this is correct, what should the differences be from one view LOD up close to one that is farther away?

 

If I've missed some good tutorials, my apologies! :D I might try and put one together when I understand a bit more!

 

PS: Cheers all, who've been very patiently and politely helping me with the modelling on these forums - you know who you are!

1. Regarding the so called stencil shadows - those should be, in the vast majority fixed already. All models should create soft shadows. Stencil shadows is A2 legacy way of dealing with shadows, and should be active only when using low shadow ingame preferences. 

 

2. Regarding ShadowVolume lods - the engine uses this geometry to create the shadow. Since shadows per say is not the slowest computation per object, but it is also a matter of draw calls. If the engine needs to display a lot of shadows for 20-30k faced objects it's gonna struggle a lot more than trying to figure out shadows for an 1k object. Again, i am really hoping that we could leave without some of these lods in the future iterations of the engine. All those resolution lods, or view lods as you call them should have LodNoShadow 1 named property set (if you use this name prop on res lods and have no shadow lod, there will be no shadow whatsoever)

 

On the same subject: after a certain distance the game will try and use a shadowbuffer model for the shadows that are displayed. this is controlled by the sbsource named property (to be added in the geo lod - don't ask me why) that has a few options: none / visual / shadowvolume / explicit - more on the subject here: 

https://community.bistudio.com/wiki/Oxygen_2_-_Manual#Resolution_LOD_named_property

and 

https://goo.gl/l4DIfF

 

3. One could get away with only 2 SV lods - 0.000 and 10.000. Ideally the SV lod should have max 1000 points for 0 LOD and max 100 for the 10 LOD. More here: https://community.bistudio.com/wiki/Creating_Shadow_LODs

 

4. A res Lod (the ones you call view lods) are the ones that show up and are rendered by the engine. based on distance versus draw calls, they are being shown on the screen by the engine from the ones with the most amount of faces to the least. They should get halved down. Say LOD 0 is 1000 faces. LOD 1 should be 500, LOD 2 should be 250 LOD3 125 LOD 4 67 and so on. They should retain the overall silhouette but loose geometry, so when the engine does the switch it should be not obvious. 

 

5. View Geo LODs are what AI sees. 

 

And you haven't missed some good tuts, there aren't really any :)

  • Like 4

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×