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

CanvasItem modulate property not working when YSort Enabled is set to true #63994

Closed
HexagonNico opened this issue Aug 6, 2022 · 7 comments · Fixed by #77079
Closed

CanvasItem modulate property not working when YSort Enabled is set to true #63994

HexagonNico opened this issue Aug 6, 2022 · 7 comments · Fixed by #77079

Comments

@HexagonNico
Copy link
Contributor

Godot version

4.0 alpha 13

System information

Manjaro Linux x86_64, Kernel 5.15.57-2-MANJARO, GPU Nvidia GeForce RTX 3050, Driver version 515.57, Vulkan Mobile

Issue description

Children of Node2D nodes ignore the parent's 'modulate' property if 'y sort enabled' is set to true. If y sorting is not enabled, child nodes inherit the parent's color, but when it is enabled the color is ignored.

Steps to reproduce

  • Create a Node2D
  • Change its 'modulate' property
  • Add a Sprite2D node as a child of the Node2D and add any texture, the sprite should inherit the Node2D's modulate color
  • Now set 'y sort enabled' in the Node2D to true, now the Sprite2D node no longer inherits the parent's color

Minimal reproduction project

Report-ModulateYSort.zip

@HexagonNico
Copy link
Contributor Author

Update: I'm trying to reproduce this issue in Beta 1.

I created a new project and it seems to be partially fixed, now the 'modulate' property only stops working if the node's parent also has 'y sort enabled' set to true.

For instance, this works as expected:

  • Node2D (y sort enabled = false)
    • Node2D (y sort enabled = false, change modulate color)
      • Sprite2D (color is inherited)
    • Node2D (y sort enabled = true, change modulate color)
      • Sprite2D (color is inherited)

This does not:

  • Node2D (y sort enabled = true)
    • Node2D (y sort enabled = false, change modulate color)
      • Sprite2D (color is inherited)
    • Node2D (y sort enabled = true, change modulate color)
      • Sprite2D (color is NOT inherited)

@HexagonNico
Copy link
Contributor Author

Still happening in beta 3

@HexagonNico
Copy link
Contributor Author

I have updated to version 4.0.1 stable and this seems to have been resolved, except for CanvasGroup nodes, although I'm not sure if this should be considered as expected behavior for the latter. Can someone confirm that?

@eh-jogos
Copy link

eh-jogos commented Apr 2, 2023

I have updated to version 4.0.1 stable and this seems to have been resolved, except for CanvasGroup nodes, although I'm not sure if this should be considered as expected behavior for the latter. Can someone confirm that?

For me this is still happening, regardless of node type, tested it with plain Node2D and plain Control nodes in the issue I submitted. Did you do anything different to solve it for other nodes?

@HexagonNico
Copy link
Contributor Author

Just checked, apparently it is working when changing the modulate color of the root node, but not for the children.

@hsandt
Copy link
Contributor

hsandt commented May 5, 2023

Just got the bug, I'll add some pictures since there aren't any in the OP:

Tree
image

Y Sort disabled
image

Y Sort enabled
image

The icon parent says "modulated", the children lost their color tints.

The reason why only children are affected is probably that they are temporarily "detached" from their parent from the PoV of the renderer to apply Y sorting with nodes elsewhere in the scene tree.

@Crystalwarrior
Copy link

still happens in godot 4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants