dustyroom-studio / quibli-doc

Documentation of the Quibli asset.
https://quibli.dustyroom.com
2 stars 1 forks source link

Weird shadow if I enable "Receive Shadows" #14

Open shuskry opened 2 years ago

shuskry commented 2 years ago

Hello, I have a probleme with the Qhibli Shader.

Describe the bug

When I enable "Receive Shadows" , the shadow are horrible and create some line artefacts. Instead of self shadowing wich appear great

To Reproduce Steps to reproduce the behavior:

  1. Create a new Material and assign the Qhibli Stylized shader
  2. Click on "Receive Shadows" on the lighting option.
  3. The prolem appear

Expected behavior

I expect to the shadow to be soft, or cell like the self shadow when set the gradient of shading to fixed

Screenshots

Only the rock have the "receive shadows" enabled, Character don't screen_shadow

Read me Info

Version 1.4.8 Unity 2021.3.0f1 ( URP) Dev platform: WindowsEditor Target Platform: IOS URP installed: True, version 12.1.6 Render Pipeline: UniversalPipeline Color space: Linear Quality Config: N/A Graphics config: H - Renderer ( name of my renderer)

EDIT : -I'm using maximum shadow resolution in URP settings

-I also try adjusting the Shadow Bias setting, but to have a more "real" shadow, I have to put some invalid number and I have some shadow far from the object and create weird stuff

-I Also try with a mesh with more polygon count ( Unity 3D Sphere), and the result is the same

Have a good day :)

dustyroom-studio commented 2 years ago

Hi,

Thank you for such a detailed report!

It is a known and widely reported Unity issue — this is how Unity handles realtime shadows with stylized shaders, not only Quibli's Stylized Lit shader. We keep looking for the ways to minimize this effect in Quibli.

Please, make sure you tried overriding the default shadow. Here's a description - Stylized Lit Override Default Shadow. Below is an effect:

quibli-stylized-lit-override-default-shadow

Here is another one open ticket on this issue, you can find more info there, including a workaround: https://github.com/dustyroom-studio/quibli-doc/issues/11

shuskry commented 2 years ago

Thanks for your awnser ,
I follow your advice and here the result : screen_shadow

Unfortunately it's doesn't resolve the issue :/ ...

I allow myself to ask, but why you dont create , like the self shadowing , a "fake shadow" by overwritting the Light and create the same cell effect on it ? ( Don't know how it's difficult to do , so I supposed it's for that x) )

then, I saw that "occlusion" can be at the same place where the real shadow need to be , but the color are sooo much darker , there is a way to change the Occlusion color/opocity ? like the main shadow ? maybe it can trick the thing ? screen_shadow

I tried the workaround but the result are not what exepecting ...

Thanks for your time !

dustyroom-studio commented 2 years ago

Thanks for the suggestions! Some answers:

why you dont create , like the self shadowing , a "fake shadow" by overwritting the Light and create the same cell effect on it ? ( Don't know how it's difficult to do , so I supposed it's for that x) )

We have limited ability to override the shadows cast by an object onto other objects, because Unity is responsible for building the shadowmaps using cascades. Unity renders an image from the point of view of each light to get the "occluded" regions where the shadows should be. The only information exposed to shaders is a single number indicating the fragment being shadowed or not. However, for the shadows that an object casts onto itself - your suggestion seems to be exactly what we're doing already. For example, on the stone in the screenshot above your gradient includes a darker region. What you describe seems equivalent to adding another (even darker) region on the same gradient. Am I missing something?


I saw that "occlusion" can be at the same place where the real shadow need to be , but the color are sooo much darker , there is a way to change the Occlusion color/opocity ? like the main shadow ? maybe it can trick the thing ?

That's a good point. The problem seems to be that we apply the shadow color only using the "shadow attenuation" (Unity's name), but we should be applying it to "distance attenuation" as well. We can make that change, but will need to evaluate it properly first. If you'd like that change right away, please shoot us an email at info@dustyroom.com.