Skip to content

Conversation

ivanpopelyshev
Copy link
Collaborator

@ivanpopelyshev ivanpopelyshev commented Oct 20, 2021

V6 fix for #7855

This is more permanent solution: API allows to remove whole subtree from render. Scissor handler calculates whether intersection of scissor rect and screen is 0, in that case it doesnt bother scissor at all, evading w=0,h=0 bug on iOS and ANGLE with integrated video.

There will be new tests for this.

Bugged: https://www.pixiplayground.com/#/edit/2qJVNoyRHDVPMtaTJ4hCY
Fixed: https://www.pixiplayground.com/#/edit/NXMa4bNf_v9iVfX0IxNKb

Can be tested on iOS15 or any integrated videocard with ANGLE

@ivanpopelyshev
Copy link
Collaborator Author

@GoodBoyDigital what do you think about MaskHandler?

Maybe add a runner like that somewhere? Im sure we need third param because that shows that Container is ready to handle the result DONT_RENDER, because several people copied implementations of renderAdvanced and i want backwards compatibility for them.

@eXponenta
Copy link
Contributor

eXponenta commented Oct 20, 2021

Looks like how breaking change, because it change a Container default render implementation (public API), and has side effects for libs and codebase that use custom container implementation.

Can you guarantee that fix will working and witout checking doRender?

If not, i not think that this is full solution.

Logicaly a dropping subtree when mask is empty not should be a main solutions for 'flipped bechavior', only as optimization of redundant operation.

Then there are a some projects that depends of 'render' call, which you kill in so specific case that cannot be tracked outside easily.

then, using a state of mask data inside 'render' logic increase a coupling bethween modules, and increase fail results for each masked objects by invalid results of 'pushMask' (in another case we can see a bugged render results, in this we can hang a doRender = false and nothing will rendered at all)

@ivanpopelyshev
Copy link
Collaborator Author

Old implementations of container.renderAdvanced do not pass third param in push() therefore, they will behave like before.

Yes, this is basically renderable=false for whole subtree. If user plugins take into account that renderable=false happens, this thing wont be a problem for them.

However, I see the problem with my idea - textures in that subtree wont be touched and might be removed by texture GC after 3 minutes or so of being in such mask.

@jmlee2k
Copy link
Contributor

jmlee2k commented Oct 20, 2021

@ivanpopelyshev - thanks for the quick fix! The issue is fixed in our codebase, but it causes some issues with nested masks. I'll put a reproduction case together.

@ivanpopelyshev
Copy link
Collaborator Author

ivanpopelyshev commented Oct 20, 2021

@ivanpopelyshev - thanks for the quick fix! The issue is fixed in our codebase, but it causes some issues with nested masks. I'll put a reproduction case together.

yes, maybe i can make this PR with different mode: "stencil instead of empty scissor" implementation. Like, if mask is scissor and its empty, do stencil instead.

@jmlee2k
Copy link
Contributor

jmlee2k commented Oct 20, 2021

@ivanpopelyshev - here's a quick test I made: https://www.pixiplayground.com/#/edit/7biTBgB4JJLB25b7epBoG

it should look like this: (red and blue areas are sprites inside masked containers)
image

but it looks like this:
image

@ivanpopelyshev
Copy link
Collaborator Author

OK, agree, i'll just make easier separate PR tomorrow

@ivanpopelyshev
Copy link
Collaborator Author

Closed in favor of #7896

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

Successfully merging this pull request may close these issues.

3 participants