Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas background mode for world environment won't display a background #67633

Closed
EamonnMR opened this issue Oct 19, 2022 · 3 comments · Fixed by #68805 or EamonnMR/galactic-night#11
Closed

Comments

@EamonnMR
Copy link

EamonnMR commented Oct 19, 2022

Godot version

v4.0beta3

System information

Lubuntu

Issue description

Using a canvas background in a world environment results in a blank background.
I think the issue stems from the way gd4 handles negative canvas layers. In order to use a canvas as a background in GD3 you'd set it to a negative layer (so it's not drawn on top of the 3d scene) then set the max layer on the environment background to -1. This would result in your canvas being drawn in the background of your 3d scene. In GD4, when you've set the background to canvas, setting a negative max layer results in nothing being drawn, resulting in a hall-of-mirrors effect instead of your background.

This is a problem because it seems to break using a canvas as a background, which would be the intent of the canvasBackground mode for WorldEnvironment.

This appears to be a regression from Godot 3, where this worked.

(Edit: repro'd this in Beta 3, same issue)

Steps to reproduce

Three top level nodes:

  • CanvasLayer
    Put some stuff in to draw
    set layer to -1
  • WorldEnvironment
    Set background to canvas, max layer -1
  • Spatial
    Put in a camera and some 3d stuff to draw

This illustrates the problem.

Minimal reproduction project

canvas_background_example_gd3.zip
canvas_background_example_gd4.zip

@Calinou
Copy link
Member

Calinou commented Oct 19, 2022

Related to #52467.

@EamonnMR
Copy link
Author

It may be the same fix as above, but this presents in a fairly different context (most of the discussion there is about how it breaks 2d) so I think it's worth keeping open as an issue, but that's up to you!

EamonnMR added a commit to EamonnMR/galactic-night that referenced this issue Oct 20, 2022
Due to this issue in GD4 Beta: godotengine/godot#67633

I'm switching the background to a giant quad behind the camera. Haven't ported the
shader yet.
@MaybeAnonymous
Copy link

I have the same problem on Godot 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants