The Wayback Machine - https://web.archive.org/web/20260108110102/https://github.com/godotengine/godot/issues/28628
Skip to content

Ability to include transparent objects in screen texture #28628

@TheMonsterFromTheDeep

Description

@TheMonsterFromTheDeep

Godot version: 3.1.1

OS/device including version: Windows 10

Issue description:

Currently it is not possible to create a material that performs refraction while maintaining visibility of transparent objects behind it.

I understand that it is more generally the case that screen-space shaders are not capable of reading color data written by transparent objects (as per #18332).

This is turning into a significant problem for the game I'm working on. In short, I'm making a marble platformer that will have a character inside the marble, appearing to push it around. However, I am fairly certain that I can only make said character look the best through the use of transparent materials, but this prevents me from using a refractive material on the marble, as doing so would prevent me from using transparent materials on the character (which is probably more important, from an artistic standpoint).

It would be optimal if I could use transparent materials on the character and a refractive material on the marble. I can't tell if this is actually technically impossible (as per #11523) or if it is just done for efficiency. If it is just done for efficiency, there should be some sort of way to control that, perhaps some options for what transparent materials write to (e.g. a "write to screen texture" and a "write depth" option).

Steps to reproduce:
Create an object with a transparent material and put it behind an object with a refractive material (i.e. one with "Refraction" enabled).

Minimal reproduction project:
TransparentRefractionTest.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions