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

Discussion about basic scissors masking implementation on StageGL #970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Nestorferrando
Copy link

@Nestorferrando Nestorferrando commented Jun 28, 2018

Hi! We have been using EaselJS for over one year in several proyects and really fits our needs: really similar to old flash approach, works fine on any platform we tested, good integration with adobe animate...

However, for our next project we need some basic masking features, with 'as good as possible' performance on mobile phones.

I've been trying to understand the StageGL implementation and I made some code that performs gl.scissors-based masking over mask bounds added to containers or movieclips.

I made some tests and it seems to work, but, with this PR I want to ask you about your opinion, if you think I'm breaking something I didn't realized, or if it seems a good approach.

Basically, what I did was modify the _appendToBatch method. If a mask is found in a container, it forces to render the current batch, applies masking, and start appending the new elements. After all the items that should be masked are added. I force to render the current batch and remove the mask.

Thanks a lot!

@DavidHGillen
Copy link

The approach sound solids, if we had an issue with anything it's probably be us being picky about the API. I'll dig into this later (check things like nesting, scaling, etc) but on the high level it sounds like how I was hoping to implement something similar.

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

Successfully merging this pull request may close these issues.

2 participants