Godot: Unexpected "shadows" with SS reflections

Created on 5 Jan 2020  路  6Comments  路  Source: godotengine/godot

Godot version:

Godot Engine v3.1.2.stable.custom_build
OpenGL ES 3.0 Renderer: GeForce GTX 970/PCIe/SSE2

OS/device including version:

Linux 5.4.7-arch1-1

Issue description:

A reddit commenter pointed out some unusual visual artifacts in my game with SS reflections. It almost appears that a mesh is casting shadows over the reflections, but there's no light source behind the mesh that would be casting those shadows.

1578263432

Possibly related to https://github.com/godotengine/godot/issues/9017, https://github.com/godotengine/godot/issues/15527, https://github.com/godotengine/godot/issues/17995

Steps to reproduce:

  1. Create a plane with a SpatialMaterial that has roughness=0, metallic=1
  2. Create a cube with a SpatialMaterial that has emission=4
  3. In the environment, set Background.mode=CustomColor=black, and enable SS Reflections
  4. The cube should reflect off the plane
  5. Add another MeshInstance and move it around between the cube and the camera
  6. Note that it blocks parts of the reflection, even if it is not between the cube and the plane

Minimal reproduction project:
example.zip
1578262936
^^^ note that the sphere is well above the cube in this picture, but it is taking a "chunk" out of the reflection.

documentation enhancement rendering

Most helpful comment

I'm not sure if this is a bug or a limitation of the screen-space reflection algorithm. In the screenshot with the white sphere and cyan cube, it looks like the reflection is short on the right side of the screenshot because the cyan cube is only partly visible on that side. In other words, SSR can't reflect what's being occluded by other geometry.

Out of curiosity, does this still occur if you disable Rendering > Quality > Depth Prepass > Enable in the Project Settings?

All 6 comments

Glad to see you were able to isolate and replicate the issue!
Here is a quick gif from your project that shows it in action.
ss_reflection_issue
I noticed even the laser beams in your video cause the same effect.

I'm not sure if this is a bug or a limitation of the screen-space reflection algorithm. In the screenshot with the white sphere and cyan cube, it looks like the reflection is short on the right side of the screenshot because the cyan cube is only partly visible on that side. In other words, SSR can't reflect what's being occluded by other geometry.

Out of curiosity, does this still occur if you disable Rendering > Quality > Depth Prepass > Enable in the Project Settings?

Rendering > Quality > Depth Prepass > Enable does not change it. Setting no_depth_test on the sphere does (though isn't a viable solution), and setting depth_draw_mode to Never produces a different effect:

1578311677

That's a limitation on how SS Reflections work, not even big budget games like RE2 Remake found a way to get around it.

RE2R-SSR

Makes sense, feel free to close if this is just considered an implementation limitation that we're unlikely to fix in Godot. At least in my game, I consider it pretty minor, I never even noticed it without @golddotasksquestions's eagle eye!

We should improve the documentation to mention such limitations. I'll try to do this ASAP.

Was this page helpful?
0 / 5 - 0 ratings