Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many Foxes shadows vibrate #7393

Closed
hymm opened this issue Jan 28, 2023 · 7 comments
Closed

Many Foxes shadows vibrate #7393

hymm opened this issue Jan 28, 2023 · 7 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Milestone

Comments

@hymm
Copy link
Contributor

hymm commented Jan 28, 2023

Bevy version

happens after the cascaded shadow map pr c3a4682

Relevant system information

AdapterInfo { name: "NVIDIA GeForce RTX 3070 Ti Laptop GPU", vendor: 4318, device: 9376, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "517.63", backend: Vulkan }
SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "AMD Ryzen 9 6900HS with Radeon Graphics", core_count: "8", memory: "31.3 GiB" }

What you did

ran the many_foxes example

What went wrong

The shadows feel like they are vibrating. Looking at a freeze frame the shadows seem to be much lower resolution than before.

After CSM
image

Before CSM
image

@hymm hymm added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 28, 2023
@alice-i-cecile
Copy link
Member

Is this fixed by #7383? I fixed an ambiguity there that is very plausibly responsible.

@djeedai
Copy link
Contributor

djeedai commented Jan 28, 2023

I think this might be fixed by #7339 no?

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jan 28, 2023
@alice-i-cecile alice-i-cecile added this to the 0.10 milestone Jan 28, 2023
@superdump
Copy link
Contributor

I looked at this the other day - I got the feeling they weren’t vibrating, it’s just ‘aliasing’ (it visually looks like something other than it is) because the shadows are low resolution, the positions of the shadow map texels are stable, and the foxes cast shadows that move across a small number of these texels so the texels pop in and out of shadow. I may very well be wrong but that is my guess.

@danchia would you be up for looking into this with respect to #7362 ?

@hymm
Copy link
Contributor Author

hymm commented Jan 28, 2023

so the texels pop in and out of shadow

This is what it looks like to me.

@danchia
Copy link
Contributor

danchia commented Jan 31, 2023

I tweaked the cascades settings, and things look much better.
Will send PR soon, but I'm starting to think that we probably need to change the docs to nudge users to consider their needs. The current default settings work in that there are shadows, but definitely are not one size fits all w.r.t to hugely varying scene sizes.

@superdump
Copy link
Contributor

superdump commented Jan 31, 2023

@danchia on Discord, @JMS55 had the idea that we could perhaps calculate the screen space aabb of the visible objects in the view frustum and then build cascades covering that.

I’ve seen ideas previously about cascade distribution and things don’t stop at implementing ’basic’ CSM. :) I don’t remember the papers right now as I haven’t thought about post-CSM for a long time.

I feel like a quality slider bounding the worst screen/shadow texel size ratio or something could be useful… or at least to start with understanding the distribution of shadow map resolution over view distances, could be a useful approach to thinking about the shadow quality.

Plus implementing the Witness PCF. :) superdump@7025bcb

@superdump
Copy link
Contributor

Now I remember - Sample Distribution Shadow Maps: #4253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants