Page 4 of 4

Re: Trying to implement Shadow Mapping

Posted: Thu Jan 07, 2021 09:18
by Liso
Andrey01 wrote:
Wed Jan 06, 2021 21:41
I tested out the shadows today and after that I understood why this is currently even "pre-alpha" version. There is my list of discovered bugs/lacks:
And these bugs are only a small subset of them xD.


First of all, THANK YOU for testing it. You make my day :).

Second, Sorry I didn´t push the last changes in to the master branch. Could you try it with the changes I just commit in to the master?
or, you can checkout the "shadowmap" branch.


And I mostly worked in the CSM version, and it's not enabled by default. to enable it go to the all settings menu, search shadows, and enable the "Cascade Shadow Mapping" and the texture in 32 bits:

Something like this:
Image

Most of the bugs you listed are because the lack of code in the non-CSM mode.


About the "ripple" is a well known (but not easy to fix) problem with shadow mapping. The self-shadowing, or shadow acne, and basically it's a problem with precision.

The way to face it is to use a small bias when we build the shadows, but if we use too much bias we can have the opposite problem, the Peter-Panning . In theory this can be fixed using "glDepthOffset" but I don't know how to use it in Irrlicht3D.

The last version has a naive basic implementation of Slope-Scale Depth Bias, that try to minimize that problem.

I want to say I'm sorry for my lack of activity.

And again, Thank you for your help.

Re: Trying to implement Shadow Mapping

Posted: Thu Jan 07, 2021 11:03
by Andrey01
Liso wrote:Could you try it with the changes I just commit in to the master?
or, you can checkout the "shadowmap" branch.
Ok, I will try out it tonight.
Liso wrote:And I mostly worked in the CSM version, and it's not enabled by default. to enable it go to the all settings menu, search shadows, and enable the "Cascade Shadow Mapping" and the texture in 32 bits:
Hmm, i.e. those shadows that I tested were handled server-side and for that reason it caused so heavy lags? I think their rendering should occur fully client-side.
Liso wrote:I want to say I'm sorry for my lack of activity.
I am currently learning OpenGL bases and then I plan switch to learn GLSL. Maybe I can somehow help with code and fix those bugs, but that's rather long-term process because I need to learn also the part of the engine where the rendering occurs itself.

Re: Trying to implement Shadow Mapping

Posted: Thu Jan 07, 2021 13:50
by Liso
Andrey01 wrote:
Thu Jan 07, 2021 11:03

Hmm, i.e. those shadows that I tested were handled server-side and for that reason it caused so heavy lags? I think their rendering should occur fully client-side.
Yes. All the shadow mapping is done in the client.

Re: Trying to implement Shadow Mapping

Posted: Tue Jan 12, 2021 20:51
by Andrey01
It is strange, the game gets playable only if the shadow map texture size <= 2048 as FPS ranges 56-60 in such case. If I increase it twice (4096), FPS will drop down five times what is not in inverse ratio to the size growth. If one more increase twice (8192), FPS will be somewhere lower 5. Why does FPS so much drop down in the second case? At fact, then in third one it should be equal to 1, not higher.

Also, I`ve noticed nodes of 'plantlike', 'flowingliquid' and 'torchlike' drawtypes are not affected by shadows, they have the same tint as if the dynamic shadows were be disabled.

Re: Trying to implement Shadow Mapping

Posted: Tue Jan 12, 2021 22:14
by Liso
Yes, the texture size can cause a high impact in the performance and that depends on the GPU because is often limited by fillrate or memory bandwidth.

But the shadows should be good enough with 2048, or even 1024.

About the drawtypes not affected by shadows, probably the shader is wrong ;), I remember I turned off the shadow casting on torchlike.

Re: Trying to implement Shadow Mapping

Posted: Thu Feb 18, 2021 12:26
by Andrey01
Hello Liso. Just I'm interested in knowing how your development is going on :)