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

When material Distance Fade is set to PixelAlpha, object will render over editor icons/gizmos #82610

Closed
notPelf opened this issue Oct 1, 2023 · 1 comment

Comments

@notPelf
Copy link

notPelf commented Oct 1, 2023

Godot version

Godot Engine v4.1.1.stable.mono.official.bd6af8e0e

System information

Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 31.0.15.2824) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

Issue description

I have a ground plane that I want to fade away in the distance. I have the material set to use Distance Fade to achieve this effect, however it causes the ground plane to render over top of the editor icons/gizmos/grid. This behavior occurs when Min Distance > Max Distance and also when Max Distance > Min Distance.

Mode = PixelAlpha (particles icon & raycast gizmo not drawing over plane as expected)
pixelalpha

Mode = PixelDither (expected behavior where icons/gizmos draw over top of plane with Distance Fade material)
pixeldither

Steps to reproduce

  1. Create new 3D scene
  2. Add a MeshInstance3D, set mesh to new PlaneMesh
  3. Add a CPUParticles3D (or any other Node which will have a gizmo/icon shown in the editor... a raycast 3d also works)
  4. Move the CPUParticles3D upward (e.g. y=0.2)
  5. Select the MeshInstance3D > Surface Material Override > New StandardMaterial3D
  6. Change albedo to some dark color to make it easier to see what's happening
  7. Set Distance Fade to PixelAlpha, Min Distance to 4, Max Distance to 3

Zoom the camera in and out to see how the plane is rendering over top of the CPUParticles3D icon even though the CPUParticles3D is higher up. Now change the Distance Fade mode to PixelDither and observe the intended rendering order.

Minimal reproduction project

DistanceFadeBugMinRepo.zip

@Calinou
Copy link
Member

Calinou commented Oct 1, 2023

Thanks for the report! Consolidating in #24069, as this is due to the same cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants