-
-
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
Feature: Add vertex color alpha channel support. #20975
Conversation
I think I prefer the name Please also update the TS declaration file and the documentation.
It's good if at least one example demonstrates the usage. However, I would enhance an existing buffer geometry example like webgl_buffergeometry. |
No problem.
I wasn't aware of the TS files. Will do. The contribution guide says
I'll modify that example. |
Oh, I was not aware of that line. TBH, I think it's better if the documentation is always updated with the same PR that changes code. |
I actually agree. Let's break that rule in this PR 😈. |
This PR clarifies the update of documentation pages, see #20975 (comment).
Thanks for your review @Mugen87. Are we waiting for other collaborators’ review now? |
Yep. @mrdoob will have a look at this PR and merge it when everything is fine. |
@chubei Do you mind updating the PR? There is now a merge conflict since all TS type declaration files were removed. |
Rebased and force pushed. Sorry for the delay. |
Wow, this looks great! We would be really happy it it was merged. |
Code based has changed since last approval.
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.
Using vec4
by default is a breaking change and can't be accepted.
I tried to implement automatic inferring |
I think we should stick to |
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.
Not approving an inferring approach.
@mrdoob What’s your opinion on this? I prefer the inferring approach, but am also fine with merging the previous version. |
Hmm... On the API ergonomics side, inferring is a big win. We can also remove 3 checkboxes from the editor (which is usually a good signal API wise too): I agree with @chubei that instead of I also understand that this would force people have to duplicate geometries and that could result in increased memory, but I'm not sure how much of a concern it should be for most of the cases. How about we try the inferred approach in this case so we can see what the real consequences are? |
Okay, that sounds good to me. |
src/core/BufferGeometry.js
Outdated
@@ -879,6 +879,14 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy | |||
|
|||
}, | |||
|
|||
hasColorAlpha: function () { |
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.
I don't think we want to expose this method.
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.
Yes, this also looks strange to me. Any suggestions where I should put this method? Don't feel like to repeat the code in WebGLRenderer.js
and WebGLPrograms.js
.
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.
I would indeed inline it for now.
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.
Agreed! I was going to clean that up after merging it tomorrow.
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.
I would indeed inline it for now.
Sure thing. Updated.
I've spent some idle thinking on this issue over the last few days and I came up with another reason to remove There are quite a few bug reports of Similarly, My hunch is that the extra VAOs are worth it so users can finally reuse materials without bumping into these issues and being forced to understand the internals. |
Hmm, I'm going to merge this and do another PR some changes to it for your review. |
Thanks! |
Related issue: Fixed #16403.
Description
A new shader macro
USE_VERTEX_OPACITY
is added to control if the attributecolor
is avec3
orvec4
.Corresponding flag in
Material
is.vertexOpacities
.Does this need a new example? @donmccurdy @mrdoob @Mugen87