+1 vote

I have created a SpatialMaterial with refraction.

Behind that material is a material with transparent flag (using png texture).

The transparent material is not visible, if behind the material with refraction.

Is it possible to make the transparent material visible somehow?

enter image description here

Thanks.

asked Sep 26, 2018 in Engine by Whypay (25 points)

1 Answer

+2 votes
Best answer

Quick answer:
No.

Long answer:
To understand why this wouldn't work, you have to understand Godot's rendering pipeline. In 3D, the first objects Godot renderers are ones with a solid material, i.e. materials that neither-

  1. Are transparent.
  2. Use the temporary screen buffer.

These solid objects are the ones that get rendered into this screen buffer, which by the way is the same texture available in a shader as SCREEN_TEXTURE.

It is this texture that SpatialMaterials use to render the refraction effect. So they don't actually blend with the background like transparent materials normally would.
So with all these facts we can now come to a conclusion. Since transparent objects don't get captured in the screen buffer, they will not show up in a refraction.

answered Sep 26, 2018 by SIsilicon (3,796 points)
selected Sep 27, 2018 by Whypay
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.