StrandedKitty / three-csm

☀️ Cascaded shadow maps (CSMs) implementation for Three.js
MIT License
304 stars 22 forks source link

Custom splits #4

Closed swift502 closed 4 years ago

swift502 commented 4 years ago

I tried all three modes, but none of them worked well with my setup. The breaks I found work best for me are: [ (1/3)^3, (1/3)^2, (1/3)^1, (1/3)^0 ]

It's probably just highly dependent on the near / far distances, and general scale of my scene right?

I think an option to define a custom splits should be there as a last resort option when none of the previous modes work with your setup. But I'm the only person using this right now, so it's up to you if you want to accept this.

What do you think?

StrandedKitty commented 4 years ago

In the reference 4 (GPU Gems 3. Chapter 10) three schemes are presented. It is explained there why practical one is the most optimal for all scenes.

Maybe there's a bug somewhere in my implementation. I'm going to use CSMs in my other project (raw WebGL) soon, so I'll try to review my code from this repository.

schemes

I'll merge this, but please replace spaces with tabs.

swift502 commented 4 years ago

Hmm, yeah I tried manually setting the mode to practical (but it's also the default one right?) and it was way off. I'll make a video showcasing it.

swift502 commented 4 years ago

Should be all addressed. Let me know if I missed something.

Edit: Ok correction, it's not "way off". Logarithmic was "way off", I got them mixed up, sorry. Practical is ok, probably works as intended, but I really need the first cascade a lot closer than where Practical puts it to get more resolution out of it.