-
Notifications
You must be signed in to change notification settings - Fork 350
pen transparency fix #418
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
pen transparency fix #418
Conversation
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.
Thanks for tracking down and fixing this!
I think the other call to gl.clearColor
, down in _setCanvasSize
, should be changed too. Even better: you could set a constant near the top of the file and use that constant in both gl.clearColor
calls.
Yeah, I made the pull request a little too early and forgot to double-check that. There's also one more thing that needs to be changed - I think the pen layer is rendered with the wrong blend functions. However, I couldn't find out which function is responsible for rendering the pen layer to the stage - could you help me out there? @cwillisf |
changed clearColor on `_setCanvasSize`
Modified blend function in `_drawThese` to blend skins with premultiplied alpha correctly
Transparent pen now works just as expected, but now there's an issue when stamping transparent sprites. Once that is fixed this should all be working though. |
Transparency works correctly now, both for pen, stamping and transparent sprites. Looks like the |
I just tested it on scratch.mit.edu, and it looks like the |
@cwillisf Can you re-review? |
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.
Thanks for the fixes... this looks great now!
Testing notes: this project should look the same in both Scratch 2.0 and Scratch 3.0. It's based on project 277120576 linked above, but this version loads in the old editor as well. |
Clears the pen framebuffer with transparent black instead of transparent white so transparent parts of the pen layer don't show up lighter than they should anymore.
See https://scratch.mit.edu/projects/277120576/.