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

Lines appear black (Forward+) or not at all (Mobile) in screen_texture (such as BaseMaterial3D refraction) #86078

Open
Calinou opened this issue Dec 12, 2023 · 1 comment

Comments

@Calinou
Copy link
Member

Calinou commented Dec 12, 2023

Tested versions

  • Reproducible in: 4.0.stable, 4.2.stable

System information

Godot v4.2.stable - Fedora Linux 39 (KDE Plasma) - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 545.29.06) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

Lines normally Lines behind refractive material
Screenshot_20231211_231955 Screenshot_20231211_232000

This mainly affects the editor as lines seen through a refractive material will appear black. It can also affect projects that use line drawing (e.g. when using Visible Collision Shapes or Visible Navigation).

A more minimal example where the issue may be more obvious:

image

The refractive material is the box in the middle.

In 3.x, lines don't appear at all behind refractive materials, regardless of whether GLES3 or GLES2 is used.

This appears to be related to the depth prepass: disabling it in the Project Settings while using Forward+ hides the black lines behind refractive materials.

Steps to reproduce

  • Create a mesh with a BaseMaterial3D attached.
  • Decrease albedo color's alpha to 0, decrease roughness to 0.0 and enable refraction on the BaseMaterial3D. Set refraction scale to 0.0.
  • Move the camera around so the origin and grid lines appear behind the refractive material.

Minimal reproduction project (MRP)

test_refraction.zip

@clayjohn
Copy link
Member

clayjohn commented Dec 12, 2023

This is caused by the lines using depth_draw_alpha_prepass. I'm not sure why they do though. At any rate, this will be fixed by #83895

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