XaiJu
enlit3d
enlit3d

patreon


Shadows

Spend most of today getting shadows to work and got it working in an acceptable fashion for demo#1.

What is the issue you ask? Well, the first observation is that the view distance in a third person view game is far larger compared to an indoor setting like Heroine Rumble was. The second is the player moves and looks around, and there is potentially a much large area that the shadow need to cover. The underlying issue, in short, is that a statically placed shadow setup no longer works. And it requires something smarter.

I'll spare you the details, but the end result is a shadow system that only "draws" shadows at regions where the camera/player can see.

But even then, it was not quite good enough. Here is why:

When the shadow bounds is large, there is very little resolution when viewed close:

Picking a smaller shadow "bounds" results in nicer shadows:

However, it leads to problems when views far away:

I didn't manage to completely solve the problem yet, but I have reached a good enough compromise for demo#1. That is, use a small shadow bound for nice shadows, and don't draw shadows when far away:


Shadows

Comments

Mhmm. The idea is to use "multiple" shadow textures, with large shadow bounds for distant objs and small shadow bounds for nearby objs. The technique is called Cascaded Shadow Maps. I am about halfway there with the current implementation and it'll have to be completed in a later demo than demo#1.

Enlit3D

Is it possible to tie the shadow how far away they are? Draw it sharp for close enemies, rough shadows when they are far away? I imagine a static oval might even be enough once they're really far.

Dirtyc101


More Creators