-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Changing transparent
property doesn't have any effect on materials, if true
is not provided in the constructor
#23866
Comments
It seems the following workaround works: |
true
is not provided in the constructortransparent
property doesn't have effect on materials, if true
is not provided in the constructor
transparent
property doesn't have effect on materials, if true
is not provided in the constructortransparent
property doesn't have any effect on materials, if true
is not provided in the constructor
see #23576 (comment) We updated the docs with the new behavior. The change is actually noted in the migration guide for https://github.com/mrdoob/three.js/wiki/Migration-Guide#136--137 |
@Mugen87 Oh, right, I must've overlooked, sorry. |
It works because blending is disabled. However, the define |
Describe the bug
It seems the since r137, the default value for
transparent
prop for materials need to betrue
(provided in the constructor) if you ever want to make the material transparent in its lifetime. If the default value isfalse
(or is not provided), then changing it totrue
won't have any effect.To Reproduce
Steps to reproduce the behavior:
setTimeout
, or by a click event, or anything), attempt to make the material transparent, like this:mesh.material.transparent = true; mesh.material.opacity = 0.5;
Live example
https://jsfiddle.net/9cjg5ofs/2/
Expected behavior
Prior r137, it worked as expected, users could change the
transparent
property fromtrue
tofalse
, and vica versa, and it took effect immediately.Proof of this (same code, different three.js version (r136)): https://jsfiddle.net/a7hotpb2/
Platform:
The text was updated successfully, but these errors were encountered: