-
-
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
Material: Replace .format with .alphaWrite #23166
Conversation
Thanks for making a PR.
A concern of this is if So I voted for the option B in #22598 (comment) What do you think of it? |
Sounds good to me, switched to (B) here. 👍 |
Sidenote: The docs should also reflect this change (a separate PR for this is fine): |
Thanks! |
You should simply follow the glTF spec and have Remove
|
That may be the best solution indeed... Not a fan of how GLTF is "designing" the Three.js API itself, but I guess it's inevitable. |
Hm, I can only really see Blender's Material → Settings → Blend Mode UI: |
That sounds good to me. We would then have to turn And then |
@mrdoob It is worth a try... but is it a bit complex... Here are a few random thoughts to get started:
|
Would we also want a blend-and-mask mode? glTF doesn't offer that, but it's a reasonable combination I think.
I think I would have expected |
See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166
* change: Remove RGBFormat See: mrdoob/three.js#23223 See: mrdoob/three.js#23228 * change: Remove .format from Material See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166 * test: remove use of RGBFormat from a test case
See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166
Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166
Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166
Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166
Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166
* feat: autodetect sRGB compression * feat: remove inline sRGB decode * chore: remove roughness mipmapper * feat: added constant SRGB8 * feat: WebGLCubeUVMaps: Add support for render targets * chore: Remove RGBFormat (#159) * change: Remove RGBFormat See: mrdoob/three.js#23223 See: mrdoob/three.js#23228 * change: Remove .format from Material See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166 * test: remove use of RGBFormat from a test case * feat: add LDrawUtils * chore: make ConvexGeometry points optional * chore: remove RGBIntegerFormat * feat: Box3 now supports computing minimal bounds for setFromObject * feat(Material): Add a new property .alphaWrite (#161) Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166 * chore: remove UnsignedShort565Type * chore: remove RoomEnvironment from OTHER_FILES * chore: remove LDrawLoader from OTHER_FILES * chore: fix linting * chore: fix linting Co-authored-by: 0b5vr <[email protected]>
* fix(WebXRManager): setAnimationLoop should accept null like WebGLRenderer (#158) * fix: Missing Property in Raycaster (#160) * Fix Missing Property in Raycaster Adds uv2 to Intersection interface to more accurately reflect the original documentation. See: (https://threejs.org/docs/#api/en/core/Raycaster.intersectObject)[https://threejs.org/docs/#api/en/core/Raycaster.intersectObject] This has been submitted in response to Josh's request in (this PR)[DefinitelyTyped/DefinitelyTyped#58462] * Add name to contributors * r137 (#162) * feat: autodetect sRGB compression * feat: remove inline sRGB decode * chore: remove roughness mipmapper * feat: added constant SRGB8 * feat: WebGLCubeUVMaps: Add support for render targets * chore: Remove RGBFormat (#159) * change: Remove RGBFormat See: mrdoob/three.js#23223 See: mrdoob/three.js#23228 * change: Remove .format from Material See: mrdoob/three.js#23219 It will be replaced with .alphaWrite later See: mrdoob/three.js#23166 * test: remove use of RGBFormat from a test case * feat: add LDrawUtils * chore: make ConvexGeometry points optional * chore: remove RGBIntegerFormat * feat: Box3 now supports computing minimal bounds for setFromObject * feat(Material): Add a new property .alphaWrite (#161) Since it's undocumented I could not fill the doc comment properly,,, See: mrdoob/three.js#23166 * chore: remove UnsignedShort565Type * chore: remove RoomEnvironment from OTHER_FILES * chore: remove LDrawLoader from OTHER_FILES * chore: fix linting * chore: fix linting Co-authored-by: 0b5vr <[email protected]> * feat: add PackedPhongMaterial * fix: Scene Utils are not in namespace resolves #153 * r137 * change (Material): remove `alphaWrite` See: mrdoob/three.js#23361 Co-authored-by: Cody Bennett <[email protected]> Co-authored-by: Joe Tipping <[email protected]> Co-authored-by: Josh <[email protected]>
Related issues:
Implements the solution proposed in #22598 (comment). This fixes the problem of
.transparent=true
having no effect for materials loaded with THREE.GLTFLoader, because.alphaWrite
isautomatically flipped to trueignored when.transparent=true
is set. I hope it's also a clearer name than.format=RGB[A]Format
, and more comparable to.colorWrite
.Unfortunately I'm no longer sure how to test all of the issues discussed above. The test model provided with #15483 renders correctly regardless of whether alphaWrite is on or off: