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

Fix culling on screen-space screen. #4355

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Conversation

jpauloruschel
Copy link
Contributor

@jpauloruschel jpauloruschel commented Jun 22, 2022

Fixes #4199

This PR fixes the way a Screen's cull and screenSpace properties are used on ImageElement. I confirmed that TextElement is working correctly.

The before code was not following the logic outlined in the Screen API documentation (https://developer.playcanvas.com/en/api/pc.ScreenComponent.html#cull)

cull: If true then elements inside this screen will be not be rendered when outside of the screen (only valid when screenSpace is true).

in that it was ignoring the cull property of the parent Screen and always culling. Additionally, the visibleFn (used to calculate if that element is visible for a given camera) was not being set correctly for screenSpace screens.

Before (https://playcanvas.com/project/913583/overview/culluitest):

Screenshot 2022-06-22 at 12 49 43

After (https://playcanvas.com/project/913583/overview/culluitest):

Screenshot 2022-06-22 at 12 49 12

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@jpauloruschel jpauloruschel added bug area: ui UI related issue labels Jun 22, 2022
@jpauloruschel jpauloruschel requested a review from a team June 22, 2022 12:07
@jpauloruschel jpauloruschel self-assigned this Jun 22, 2022
Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@jpauloruschel jpauloruschel merged commit e476562 into main Jun 22, 2022
@jpauloruschel jpauloruschel deleted the jpaulo-fix-screen-cull branch June 22, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui UI related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frustum culling and UI element issue
3 participants