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

pass all blending parameters to setBlending in SpritePlugin #11322

Merged
merged 1 commit into from
May 14, 2017
Merged

pass all blending parameters to setBlending in SpritePlugin #11322

merged 1 commit into from
May 14, 2017

Conversation

stuikomma
Copy link
Contributor

The SpritePlugin did not call state.setBlending with all the required parameters, which is why premultiplied alpha would not work.

This PR adds the missing parameters and adds an example showing the difference between premultiplied and non-premultiplied textures for sprites.

Left is a sprite without premultiplied alpha (and what it looked like before this fix), right is with premultiplied alpha.
image

@WestLangley
Copy link
Collaborator

Thanks for the code fix. I am not sure we need the example, but we do need to have the WebGLState docs corrected.

@stuikomma
Copy link
Contributor Author

Hi @WestLangley,
thanks for your fast reply :)

Regarding the example: It took me quite a while to figure out the right parameters (premultiplyAlpha and premultipliedAlpha). In order to have that documented and to see a demo of the issue I think an example would be of help to other devs. Maybe it should be extended to cover premultiplied alpha in general (for other textures as well as sprites).
But I'm not super attached to the example. If you don't like it, we can throw it out.

Do you create an issue for updating the docs or should I include it here?

@WestLangley
Copy link
Collaborator

You can add the docs here if you like.

@mrdoob mrdoob merged commit 2949ca4 into mrdoob:dev May 14, 2017
@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

Thanks!

mrdoob added a commit that referenced this pull request May 14, 2017
amakaroff82 pushed a commit to amakaroff82/three.js that referenced this pull request May 30, 2017
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