-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
macOS intel with integrated gpu - strange shadows artefacts #3315
Comments
looks kinda nice tho |
The lines kind of seem to be related to the edges of triangles, as if they have something to do with rasterisation or MSAA or something. The shadow maps don't use MSAA though... What happens if you disable MSAA? |
I poked cwfitzgerald (wgpu) about this and it's apparently similar to an issue filed against the wgpu shadow mapping demo but that seems to be a driver issue when using array textures for shadow maps: gfx-rs/wgpu#103 |
There is another MSAA issue with an intel integrated gpu (but on linux) in #3593 |
I can repro this issue. Let me know if I can help by triaging or testing a fix. I've reproduced it in up to date in the |
Here's something interesting:
Both machines are running MacOS Big Sur 11.6.5. This is with the "lighting" example from Bevy's v0.6.1 tag. |
I do have the same bug (also Issue #3423) There is no bug if I use crate rend3, also using wgpu. (may not be the same version) |
Correction: I also have trouble with rend3 and shadows, since some days/weeks. So it may have been caused by a macOS update. |
I've got the same issue and my research found this [https://github.com/gfx-rs/wgpu/issues/103] if that helps anyone. |
I can also confirm that I have this issue, although the results look..... slightly different than the original AdapterInfo { name: "Intel(R) Iris(TM) Plus Graphics 645", vendor: 0, device: 0, device_type: IntegratedGpu, backend: Metal } 3d.scene.pipeline.mac.intel.integrated.graphics.mov |
Ok, some interesting developments upon further analysis: As a quick note, I switched to using the most up to date example version, which has slightly different results than the comment above, but has very similar artifacts (video below): lighting.control.movWhile these issues seemed to be caused by driver bugs before, I am less certain that this is the case now. I can render the wgpu example projects without issue, which was surprising to me. I tried to render some of the other example Bevy projects, and those..... also worked fine! (Specifically, load_gltf, update_gltf_scene, and pbr) This was quite confusing, to say the least, but I quickly figured out that the issue is, as far as I can tell, completely isolated to the PointLightBundle implementation, but only the blue and red channels. The green channel is ok. The below videos, in order, are lighting.rs with 1. the point lights removed (I don't see any issues here), 2. The red point light added back in, 3. The blue point light added back in, and 4. The green light added back in (again, I don't see any issues with this channel!). Note how the red and blue channels have their own "flavor" of glitchy-ness. I don't personally know what to do to address this, but the issue now seems to be much better scoped than before, so hopefully someone will know what needs to be fixed. lighting.no.point.lights.movlighting.red.channel.movlighting.blue.channel.movlighting.green.channel.movP.S. There may also be issues with the ambient lighting, but since I don't know what the ambient lighting is supposed to look like, I can't be sure |
Update: The issue actually has nothing to do with the green channel color. After some more testing, the green channel is also bugged. The example lighting project has the green light implemented as a spotlight instead of as a pointlight. None of the color channels in spotlight are bugged, as far as I can tell. The issue is entirely related to the pointlight, and the graphical bug is so bad, that it entirely renders the PointLight entity useless for Intel integrated graphics Mac. I am considering opening a separate issue for this, as this bug seems to be an entirely different issue. However, I am hesitant to do so, as new issues relating to integrated graphic shadow issues tend to be closed quickly, referring back to this issue. |
If you're very convinced there are two unrelated issues, you can open a new one 👍 Though it may look different from the first message mostly because Bevy changed a lot since. But I'm not sure it will help... to my knowledge, not many people on rendering are trying to fix it or even have a Mac with an integrated graphic card around |
I spent some time looking at the code myself, and I’m still not sure what’s causing it. I think that it has something to do with garbage info being sent into the shadow rendering function for point lights (fetch_point_shadow, I think). Though, it’s really weird. Tinkering with the function either results in the shadows not rendering or them rendering in extremely buggy ways. |
Until this gets fixed, the only real solution is to avoid using point lights in your projects (I haven’t looked at this issue for a while, so I’m assuming that the issue is still isolated to point lights) This doesn’t just apply for Intel Mac developers either—any game designed to be playable on non-M1/2 MacOS should avoid using point lights, or else your game will suffer from the same rendering artifacts as the ones seen in this issue thread. Alternatively, if someone were to take the code from one of the other light sources and modify it to work as a point light, that would also work as a fix. |
The circling light in the lighting example is a directional light. I think the light in the animated_fox example is also a directional light. Just noting this as I’m not sure why not using point lights would help with directional light issues. |
Could someone retest on macOS 13.3? |
I tested on macOS 13.3 and didn't see a change. Still the same artifacts in |
Tested on 13.3.1 |
Could someone try to repro this with one of wgpu's examples (for gfx-rs/wgpu#103) and share their findings in that issue? |
Bevy version
Current main de8edd3
Operating system & version
macOS on an intel mac with an integrated GPU
not reproduced on an intel mac with a AMD Radeon Pro 5300M or on an arm mac
What you did
cargo run --example 3d_scene_pipelined --release
What you expected to happen
To have it display properly
What actually happened
shadows-macos-intel-integrated.mp4
Additional information
I captured a gpu frame on the intel mac, loading it on the arm mac removes the artefacts from the frame
The text was updated successfully, but these errors were encountered: