godotengine / godot

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

GeometryInstance3D transparency does not work in mobile or compatibility renderers #76774

Open fracteed opened 1 year ago

fracteed commented 1 year ago

Godot version

4.0.2 stable

System information

win10 960m + win11 3050

Issue description

The transparency parameter on a geometry instance 3d object only works in the forward+ renderer. It does not work with the vulkan mobile or opengl compatibility renderers.

@clayjohn has confirmed that it has not been added to these renderers.

Steps to reproduce

Minimal reproduction project

Not really necessary.

Calinou commented 1 year ago

This also applies to visibility range distance fade using the Self or Dependencies fade mode. Both act the same as Disabled when using the Forward Mobile or Compatibility rendering methods (https://github.com/godotengine/godot/issues/69877).

Porting GeometryInstance3D transparency and distance fade to work with the Forward Mobile rendering method should be straightforward, but it'll be more involved for Compatibility.

This line in scene_forward_clustered.glsl should give you a pointer for doing so: https://github.com/godotengine/godot/blob/64eeb04d2cb2e269d9710c38bdbf366ab3656e76/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl#L759

You will have to modify scene_forward_mobile.glsl.

eswartz commented 8 months ago

I spent a few hours before discovering this issue. I might recommend documenting this limitation . The GeometryInstance3D.transparency (etc) docs don't mention that these are only available in Forward+.

jbromberg commented 5 months ago

Just ran into this. Should at the very least be documented, but ideally support could be added.

eswartz commented 4 months ago

BTW, should this ticket be replicated into https://github.com/godotengine/godot/issues/55871? Currently it's only on the OpenGL/compatibility tracker.

Calinou commented 4 months ago

BTW, should this ticket be replicated into #55871? Currently it's only on the OpenGL/compatibility tracker.

Done.