godotengine / godot

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

3.2 RC1 Transparent material appear opaque when opaque prepass used [GLES2] #35401

Open fbcosentino opened 4 years ago

fbcosentino commented 4 years ago

Godot version: Godot 3.2 RC1

OS/device including version: Windows 10

Issue description: Setting a material as transparent and opaque prepass, alpha channel behaves weird. This was working perfectly on 3.1 and 3.2 the behaviour is shown in the attached gif: opaque_prepass_transparent

Steps to reproduce: Create a cube, create a SpatialMaterial. Set flag Transparent to True, set Opaque pre-pass. In albedo, play with alpha channel slider

Minimal reproduction project: N/A

Calinou commented 4 years ago

Can you reproduce this in any of the earlier Godot 3.2 betas and alphas?

clayjohn commented 4 years ago

I can reproduce but only on the GLES2 backend.

It seems very likely that this was introduced in https://github.com/godotengine/godot/commit/150487e7280a1847b19a27f6b1465224bb14e8d6 Before this, the object just wasn't drawn at all.

Tooniis commented 4 years ago

I'm experiencing this bug too, but it doesn't happen in the material preview Screenshot from 2020-09-06 15-28-46 Screenshot from 2020-09-06 15-28-43 Does the material preview always use the GLES3 renderer or something?

Calinou commented 4 years ago

Does the material preview always use the GLES3 renderer or something?

No, as the whole engine can only use one renderer at a given time. It must be due to something else (different viewport usage/framebuffer allocation, maybe).