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

Android editor: Somewhat random graphical corruptions when viewing meshes in inspector #83481

Closed
TheRektafire opened this issue Oct 17, 2023 · 14 comments · Fixed by #84169
Closed

Comments

@TheRektafire
Copy link

Godot version

4.2 beta 1 Android editor

System information

Godot v4.2.beta1 - Android - Vulkan (Mobile) - Moto G Power 2021 - integrated Adreno (TM) 610 - (8 Threads)

Issue description

When viewing meshes in the inspector instead of seeing the actual mesh I see random VRAM garbage on certain screens but not on others, and the actual mesh in the 3d viewport is not effected, it's only the inspector views that are effected. It seems like messing with material settings seems to cause it to go away, if I apply.a default standard material it happens but when I change certain settings like transparency or detail it goes away for some reason, maybe it has to do with incorrect rendering of opaque objects?

Screenshot_20231017-015746

Steps to reproduce

  1. Create new project
  2. Add a mesh (I tested a BoxMesh)
  3. Add a StandardMaterial3D to the mesh
  4. Go into material settings

Minimal reproduction project

N/A

@Alex2782
Copy link
Contributor

Alex2782 commented Nov 25, 2023

  • only steps 1 and 2 (without Material, Godot 4.1.3)
  • show and hide mesh preview several times (video)
Android MacOS
image Bildschirmfoto 2023-11-25 um 15 43 52
Screen_recording_20231125_154759.mp4

Material preview, initial state

Android MacOS
Bildschirmfoto 2023-11-25 um 15 59 55 Bildschirmfoto 2023-11-25 um 16 03 03

@Alex2782
Copy link
Contributor

my PR 84852 (HOST_COHERENT_BIT) does not solve these problems

@Alex2782
Copy link
Contributor

@Calinou are you familiar with the inspector? I am looking for the sources for "Mesh Preview", it is displayed via EditorPropertyResource::update_property()

@clayjohn
Copy link
Member

@Alex2782 You may want to take a look at texture_get_data

Vector<uint8_t> RenderingDeviceVulkan::texture_get_data(RID p_texture, uint32_t p_layer) {

This is likely where the issue comes from.

@Alex2782

This comment was marked as outdated.

@Alex2782
Copy link
Contributor

Alex2782 commented Nov 28, 2023

maybe fixed: #84169

Vulkan mobile: MSAA 3D causes 3D viewport to render black on phone

#67204


viewport->set_msaa_3d(Viewport::MSAA_4X);

minimal reproduction project: bug_83481_msaa.zip
Bildschirmfoto 2023-11-29 um 00 43 54

@roalyr
Copy link

roalyr commented Dec 2, 2023

I can confirm artifacts happen on different Android devices on a Mobile renderer (compatibility works as intended).

Keep in mind that I am using a fork of a vanilla Godot 4.x with extended z-far and in this case, logarithmic depth buffer in a shader material.

Here is a test scene on laptop:
IMG_20231202_181537_958.jpg

Here is a test scene on a tablet (Lenovo TB350FU, ARM Mali-G57 MC2)
The issue is with how omni lights render. When spheres become larger than certain scale this glitch appears, otherwise it seems fine:
IMG_20231202_181533_130.jpg

Here is a test scene on mobile (Motorola moto g(60), Adreno 618):
IMG_20231202_181550_685.jpg

@roalyr
Copy link

roalyr commented Dec 2, 2023

The test scene itself: test.zip
(Should be opened with: https://github.com/roalyr/godot-for-3d-open-worlds/releases/tag/4.x-2023.12.01 because the scale is around 1e6-1e7 units, and for vanilla to show it you have to scale everything down, but that doesn't guarantee that omni light glitch will occur).

@roalyr
Copy link

roalyr commented Dec 2, 2023

The omni light bug as demonstrated on the tablet:

video_2023-12-02_18-31-41.mp4

@Alex2782
Copy link
Contributor

Alex2782 commented Dec 2, 2023

Now I'm not sure if it has anything to do with MSAA. Mesh error outputs like here: #80371

@roalyr You could try this PR: #84852

@roalyr
Copy link

roalyr commented Dec 4, 2023

@Alex2782 will try in few days.

@roalyr
Copy link

roalyr commented Dec 5, 2023

Now I'm not sure if it has anything to do with MSAA. Mesh error outputs like here: #80371

@roalyr You could try this PR: #84852

No effect, all the same bugs.

@akien-mga akien-mga changed the title (4.2 beta 1 Android) Somewhat random graphical corruptions when viewing meshes in inspector Android editor: Somewhat random graphical corruptions when viewing meshes in inspector Dec 6, 2023
@akien-mga akien-mga added this to the 4.3 milestone Dec 13, 2023
@roalyr
Copy link

roalyr commented Dec 17, 2023

I can confirm artifacts happen on different Android devices on a Mobile renderer (compatibility works as intended).

Keep in mind that I am using a fork of a vanilla Godot 4.x with extended z-far and in this case, logarithmic depth buffer in a shader material.

Here is a test scene on laptop:
IMG_20231202_181537_958.jpg

Here is a test scene on a tablet (Lenovo TB350FU, ARM Mali-G57 MC2)
The issue is with how omni lights render. When spheres become larger than certain scale this glitch appears, otherwise it seems fine:
IMG_20231202_181533_130.jpg

Here is a test scene on mobile (Motorola moto g(60), Adreno 618):
IMG_20231202_181550_685.jpg

On motorola it now works, but there seems to be a bug related to omni light. At certain object size the light fails to render.

Screenshot_20231217-024352.png

Video: https://imgur.com/a/fSqghHU

@roalyr
Copy link

roalyr commented Dec 17, 2023

On Lenovo tablet it is all the same, so I assume there is a dedicated issue related to omni light behavior on large objects, which is present in vulkan renderer, because in GLES3 all is good no matter the scale.

Video: https://imgur.com/a/MGLpjvq

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

Successfully merging a pull request may close this issue.

7 participants