godotengine / godot

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

DEPTH_TEXTURE broken on mobile GLES 3 #60762

Open victfv opened 2 years ago

victfv commented 2 years ago

Godot version

3.5 beta 5

System information

Android 12, Adreno 640

Issue description

When I exported a project using GLES 3, proximity fade materials vanished. I converted the spatial material to a shader material and set it to display the DEPTH_TEXTURE and it's is pure black. Depth texture seems correct on GLES 2, but it's precision is too low to be usable in large meshes.

On PC it look like this: image On mobile it look like this Screenshot_2022-05-04-15-52-05-865_org godotengine proximityfadeissue PC with GLES 2: image Mobile with GLES 2: Screenshot_2022-05-04-15-56-08-007_org godotengine proximityfadeissue

Steps to reproduce

Minimal reproduction project

ProximityFadeIssue.zip

Calinou commented 2 years ago

Depth texture seems correct on GLES 2, but it's precision is too low to be usable in large meshes.

You can force high shader precision in the Project Settings (Enable High Float.Android). This has a significant GPU performance cost though.

See also https://github.com/godotengine/godot/pull/54431.