-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Make UiNode render pass respect render layers. #8332
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
daf8e8c
to
73e8a27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moves the render layer checks into the render app. Would it be possible to just check RenderLayers during extraction and just not extract the nodes that aren't visible?
I like this idea but I don't see how to do it. Does extraction run per-view? Right now there's no interaction with the view at all; how would I determine which one is the correct one to compare against? |
Have you seen #5414? This seems fairly similar. I closed it because UI nodes in the same layout would lead to very confusing results. This seem to exhibit the same behaviors. Honestly, I don't think the confusion with different RenderLayers in same layout is a reason to block this PR, but it might be worth considering it since it was a motivation in closing previous attempts at this. |
I have not seen that before. I will take some time to review the changes and discussion in that PR. |
As someone who looking to pass different UI components and information to different viewports, this feature would be helpful. |
Having to set the render layers for each ui node individually doesn't seem good. Maybe render layers could be added to UiStack instead of querying for the RenderLayers component in the extraction functions. Then when ui_stack_system walks the node tree if it finds a node with a RenderLayers component it could set all the descendants to those render layers as well. |
Given this, I'm going to close out this PR. We need a fix for this sort of thing eventually, but I don't think this is it. |
Objective
Ensures that UiNodes are only rendered to views with matching render layer configurations. Fixes #6069.
Solution
When UiNodes are queued, they are queued indiscriminately for each extracted view that exists. Since render layers can be a component of both the camera as well as the UiNode, we need to propagate the layer information in two ways:
With this data propagated, we can perform a layer intersection check when queueing UiNodes against a particular view.
Changelog
Fixed
UI components only render in views with matching render layers.