filament icon indicating copy to clipboard operation
filament copied to clipboard

abnormal soft shadow when apply PCSS shadow type

Open cjlong1213 opened this issue 2 years ago • 5 comments

Describe the bug We are developping avatar project and try to use soft shadow feature, abnormal soft shadow occurred when apply PCSS shaow type, as shown below: Screenshot_2023_1128_161420_

To Reproduce Steps to reproduce the behavior: 1.PCF shadow as below:

Screenshot_2023_1124_152751 2.Enlarge the intensity of PCF shadow Screenshot_2023_1128_160641 3.Change to PCSS soft shadow type Screenshot_2023_1128_161420

Any suggestions to fix this? Many thanks!

Smartphone (please complete the following information):

  • Device: [vivo X60pro+]
  • OS: [e.g. Android Pie 9.0]

cjlong1213 avatar Nov 30 '23 03:11 cjlong1213

PCSS is still work in progress.

pixelflinger avatar Nov 30 '23 17:11 pixelflinger

For your use case you should try VSM shadows + a small blur radius.

pixelflinger avatar Dec 02 '23 19:12 pixelflinger

We change to VSM shadow type but the abnormal shadow still occure, after enlarging the fov from 18.5 degree to 28, the abnormal shadow disappeared. Maybe there is a better way to fix this. Our use case is mobile phone, as far as I know,VSM shadow has more calculation than others which would consume more power. Is there any suggestion?

cjlong1213 avatar Dec 05 '23 07:12 cjlong1213

PCSS is vastly more costly than VSM. So from a performance standpoint, VSM is going to be better. Also since you want a soft result, you can use a very low resolution with VSM, try 64 pixels and use "stable" mode.

Which fov are you taking about? The camera? Can you send pictures of the different cases.

Without a repro case we won't be able to do much.

pixelflinger avatar Dec 06 '23 03:12 pixelflinger

@pixelflinger According to your suggestion, we change the shadow type from PCSS to VSM and set the parameters as you mentioned(64 blur size and "stable" mode), part of the shadow disappears once the blur radius is increased as shown blew: image

Any suggestion? Thanks in advance.

cjlong1213 avatar Jan 03 '24 09:01 cjlong1213