Description

Live Chat: Discord.
Get the latest builds: Patreon.
Get Mods here: Reddit.
Public Version for Heroine Rescue Team (v0.51): Here.
Download for Heroine Rumble is at the Heroine Rumble page.

Monday, January 1, 2018

Shadows, part II


Happy new years and hope everyone had a good holiday.

I have been working on the shadows on and off during the last couple of days and there is now a huge improvement over the existing shadowing system.

-------- WARNING: somewhat technical stuff below -------

In my previous post, I demonstrated the difficulty in picking an appropriate shadow map size to fit the scene. A small shadow map gives nicer shadows but the shadow is only visible in a limited distance. A large shadow map covers the entire scene but the shadows are super low quality.


Fortunately, the solution is rather simple (in theory). Rather than using only one shadow map, why not use multiple shadow maps of increasing sizes instead? Always select the smallest shadow map if possible for the best shadow quality. The largest shadow map covers the entire view frustum, and thus guaranteeing every object will be shadowed. This technique is known as Cascaded Shadow Maps for those that want to do a little more googling themselves.

And here it is, with debugging helpers enabled:


The 4 pictures at bottom left are the 4 different shadow maps used to shadow the scene.

The scene is tinted with colors to indicator which shadow map is selected for the shadow calculation. Red - smallest map, green - 2nd smallest and so on.

Here it is in action: 





All 3 pictures are taken with the same shadow setting. Compared to the single shadow map system, this new system allows for high quality shadows when viewed close up, while also shadows distant objects as well.

Getting this new shadowing system to work is extremely important, because it allows for more open areas and environments rather than just small rooms and corridors (to hide the fact that shadows had a limited range).

For example, a "forest":


When zoomed out:

1 comment:

  1. Considering how hard it was to solve this problem I find it better to not even think about dinamic light. Let torches in the walls be considered as a single source, please.

    Also in open fields the idea of clouds can be too messy but maybe just making the "sun" stronger or weaker in relation to clouds/rain is enough.

    Trees can be useful or make things harder, both seems enjoyable. Be it itens on top of trees, be it enemies or even a cat/spider/snake-girls allies/enemies being able to get on a tree and shoot/throw/jump from there.


    Different tipes of vegetation, damageble vegetation, "lumberjacking", size/shape/variation of hitboxes of the trees ... I don't even wanna think how nightmarish a perfect world would be to be done. As the focus is in the lewds I think it is better to avoid too many unfocused efforts or add it on 1.X versions. I like the way ARK is done, that game has more content added in a month than the original size of the game (big team, AA title, I know it's another reality STILL the approach is to be taken on mind)

    ReplyDelete