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

Core: Enable blending when Material.blending is not set to NormalBlending #23416

Merged
merged 4 commits into from
Feb 3, 2022

Conversation

gkjohnson
Copy link
Collaborator

@gkjohnson gkjohnson commented Feb 2, 2022

Related issue: #23408

Description

This adjusts the WebGLProgram do only prepend the #define OPAQUE flag if transparent is true and blending is not set to CustomBlending. This retains the current behavior or forcing alpha to write as "1" by default when rending non transparent flagged objects but allows the user to force blending with the "CustomBlending" flag.

Tested by creating a cube with CustomBlending and transparent = false with partial opacity:

@mrdoob mrdoob added this to the r138 milestone Feb 2, 2022
@gkjohnson gkjohnson changed the title Core: Enable blending when Material.blending is set to CustomBlending Core: Enable blending when Material.blending is not set to NormalBlending Feb 3, 2022
@mrdoob mrdoob merged commit 9b2a288 into mrdoob:dev Feb 3, 2022
@mrdoob
Copy link
Owner

mrdoob commented Feb 3, 2022

Thanks!

@gkjohnson gkjohnson deleted the blending-fix branch February 3, 2022 19:28
donmccurdy pushed a commit to donmccurdy/three.js that referenced this pull request Mar 10, 2022
…ding (mrdoob#23416)

* don't render as opaque if CustomBlending is enabled

* Add CustomBlending import

* add forgetten line

* Update "opaque" condition
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