+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


in Engine by (25 points)

1 Answer

+2 votes
Best answer

Quick answer:

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.

by (3,936 points)
selected by
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.