I'm so confused.

I want to achieve something similar to this:

(Video in which transparent water can be see with SSR drawn on top of it)
Still Image From the Video

In Godot 4 as soon as you switch on transparency for a material, it won't show SSReflections on it anymore.

From what I understand it's completely normal for any rasterization engine to not be able to show transparent materials, because transparent materials dont show up in the depth buffer.

But what is about the other way around? Rendering the SSReflections of opaque objects on transparent materials (like water)? Is this impossible in Godot?

  • So the issue is that opaque and transparent objects go into different render passes (all opaque are drawn first, then all transparent). They may not use the same exact shaders (slight variety) and may interact differently with effects (such as SSAO and SSR, which use the depth buffer not used on transparent objects). With like AAA games or custom engines, of course there are a lot of tricks you can do to handle water or other effects in special cases. But with Godot you have limited options with the built in shaders. Though you can write your own shaders, including special effects, this can get complex as you might be re-implementing a lot of what Godot already does for you.

    Beyond that, I believe environment reflections do still work on transparent objects. They are cubemap renderer reflections. They are more expensive than SSR, but you can experiment with that (check the interior / exterior flags and also box projection). You might get something that looks okay. Though this is typically used for small areas, like windows or maybe a pond. It might lot look good for open water like the sea.

Yes, it is impossible to do this in Godot. The only way to achieve this kind of effect would be to use a ray-tracing engine to render the reflections on the transparent surface. Ray-tracing engines are more accurate at rendering scenes with reflective and transparent objects than traditional rasterization engines, which usually rely on environment maps or screen-space reflections.

    GodetteAI Thanks AI. But unfortunately that can't be true. It's been done in many games without raytracing.

    So the issue is that opaque and transparent objects go into different render passes (all opaque are drawn first, then all transparent). They may not use the same exact shaders (slight variety) and may interact differently with effects (such as SSAO and SSR, which use the depth buffer not used on transparent objects). With like AAA games or custom engines, of course there are a lot of tricks you can do to handle water or other effects in special cases. But with Godot you have limited options with the built in shaders. Though you can write your own shaders, including special effects, this can get complex as you might be re-implementing a lot of what Godot already does for you.

    Beyond that, I believe environment reflections do still work on transparent objects. They are cubemap renderer reflections. They are more expensive than SSR, but you can experiment with that (check the interior / exterior flags and also box projection). You might get something that looks okay. Though this is typically used for small areas, like windows or maybe a pond. It might lot look good for open water like the sea.

    Cybereality got the point ... but, screen-reading shader materials are drawn even later (after the full frame is rendered once). So, if you implement your own SSR you can use it with transparent objects.
    A water shader will be most likely a shader material anyway to implement things like transparency by viewing angle, animated bump surface or displacement.

    Here is a great and mostly simple resource of the SSRtopic http://roar11.com/2015/07/screen-space-glossy-reflections/

    But beware ... this may cause other render issues with transparent objects and your performance may drop quit substantially because of the additional render pass.

    removed ... this reply was stupid ... nevermind