godot_heightmap_plugin icon indicating copy to clipboard operation
godot_heightmap_plugin copied to clipboard

Flashing black squares when MSAA enabled.

Open kubajz22 opened this issue 4 years ago • 5 comments

Describe the bug When you enable MSAA the terrain gets covered with these black squares which randomly appear and disappear. It doesn't matter the MSAA power but higher antialiasing seems to make the glitching appear more frequently.

To Reproduce Create a terrain and enable MSAA.

Environment

  • OS: Linux Mint 20
  • Graphics card GeForce1650
  • Godot version 3.2.3
  • Plugin version 1.4 (this issue wasn't mentioned in 1.5.x changelog)
  • Renderer used: GLES3

Video https://youtu.be/7VLR4GFhhGk

kubajz22 avatar Dec 23 '20 19:12 kubajz22

This is screaming "Godot renderer bug" or "Graphics driver bug"... it's not the first time I've seen this happen, a variant of this occurs here https://github.com/Zylann/godot_heightmap_plugin/issues/149

To my knowledge, there is nothing I can do in the plugin to fix this. It's gotta be reported to Godot, unfortnately I have no idea what it takes to make a simple reproduction project. If you manage to reproduce this in a minimalistic project it could help Godot devs to figure out what it is.

Do you have SSR enabled?

Also, I just tried on the demo, which only contains a terrain, some water planes and grass: https://github.com/Zylann/godot_hterrain_demo With MSAA x2 and x4, it did not happen. I have a GeForce GTX 1060 6GB/PCIe/SSE2 on Windows 10.

Zylann avatar Dec 23 '20 19:12 Zylann

I turned SSR off and the issue was reduced significantly, apart from few black dots here and there. It seems to be related to the detail layer. When I hide all of them, the issue is no longer present. Detail layers aren't the only thing that is affected by this though. The squares appear on other objects too. I created a new project, enabled SSR and MSAA, added a detail layer and it was covered with black, though it wasn't flashing like in the video. Now, it actually isn't truly random. In my other project, when I disable wind, I can pan the view and find a spot where it goes black and it stays like this.

kubajz22 avatar Dec 23 '20 21:12 kubajz22

In https://github.com/godotengine/godot/issues/15527 reduz indicates it could be due to an exceeded number of texture samplers, which would be a limitation of your graphics card. If that's the case, the solution is to use less effects and lower-end shaders. It's only a supposition though.

Zylann avatar Dec 24 '20 04:12 Zylann

Apparently this works for me with detail shader. ALBEDO = clamp(ALBEDO, 0.0, 1.0);

7Arz avatar Feb 14 '21 04:02 7Arz

That might workaround the symptoms, but something is still broken. Albedo should not be blowing up like that in the first place 🤔

Zylann avatar Feb 14 '21 15:02 Zylann