godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.5k stars 19.27k forks source link

Setting MSAA 3D to 8x blurs everything when using DOF #88064

Open passivestar opened 5 months ago

passivestar commented 5 months ago

Tested versions

v4.2.1.stable.official [b09f793f5]

System information

Godot v4.2.1.stable - macOS 14.2.1 - Vulkan (Forward+) - integrated Apple M1 Max - Apple M1 Max (10 Threads)

Issue description

When using DOF, setting MSAA 3D to 8x is doing something weird:

https://github.com/godotengine/godot/assets/60579014/1b470c60-1f50-4c27-8954-0723ec092604

Steps to reproduce

  1. Create a project
  2. Create an environment with either CameraAttributesPhysical or CameraAttributesPractical
  3. Set MSAA to 8x

Minimal reproduction project (MRP)

MRP_MSAA.zip

Calinou commented 5 months ago

Apple Silicon GPUs don't support 8× MSAA (due to them ultimately being TBDR mobile GPUs); they only go up to 4×. I'm surprised there's any visual difference between 4× and 8× MSAA due to this.

My guess is that some of the MSAA resolve passes aren't checking the maximum supported MSAA level and are using 8× MSAA even though the general buffer is clamped to 4×.

Potential areas where a call to _ensure_supported_sample_count() is missing:

passivestar commented 1 month ago

https://github.com/godotengine/godot/pull/88199 fixes this issue