godotengine / godot

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

MeshInstances turn black after waking up from suspend #60820

Open J3fflo opened 2 years ago

J3fflo commented 2 years ago

Godot version

3.4.4.stable

System information

Arch Linux with GNOME 41 64-bit, GLES3, AMD Ryzen 5, NVIDIA GeForce GTX 1650 Also, I use X.ORG X11

Issue description

MeshInstances turn black after the computer is restored from suspend. MeshInstance: Simple Cube Mesh Instance

Material definitions (globally):

var mat_sand = SpatialMaterial.new()
var mat_grass = SpatialMaterial.new()
var khaki = Color.khaki
var mediumseagreen = Color.mediumseagreen

Albedo color assignment and material override on the main mesh in func _ready:

mat_sand.albedo_color = khaki
mat_grass.albedo_color = mediumseagreen
...
m.material_override = mat_grass
# where m is an instance of a scene that only contains a MeshInstance

The issue seems to resolve when you re "play" the scene in godot image Expected: image

Out of curiosity, I built the project (without debug) and the issue still persists, the only way I could find to fix it was to restart the game (which could be quite irritating)

Side Note: This also occurs on linux with the editor minimap (#58989) image

Steps to reproduce

Suspend pc and start it up again (with the game running in godot)

Minimal reproduction project

No response

lawnjelly commented 2 years ago

Possibly we are not responding to a lost GL context, something like that (if it is not a driver / OS problem).

Calinou commented 2 years ago

Possibly we are not responding to a lost GL context, something like that (if it is not a driver / OS problem).

Suspend on Linux has always been more finnicky than on Windows or macOS, especially when the proprietary NVIDIA driver is involved. Other OpenGL 3D applications generally don't suffer from this problem though, so it is technically possible to resolve it.