-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
BufferGeometry: Renamed uv2, uv3, uv4 to uv1, uv2, uv3 #25943
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
…etAttribute() and deleteAttribute().
|
The |
|
I've updated all the code locally and I'm not loving this new pattern: this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
- this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
+ this.setAttribute( 'uv0', new Float32BufferAttribute( uvs, 2 ) );I think for now I'm just going to go for this:
|
|
Hmm, I'm having a hard time trying to predict the side effects of this code: // Backwards compatibilty
Object.defineProperties( this.attributes, {
'uv2': {
set: function ( value ) {
if ( this.uv1 === undefined ) {
console.warn( 'THREE.BufferGeometry: The attribute uv2 has been renamed to uv1.' );
this.uv1 = value;
}
delete this.uv2;
},
configurable: true
}
} );I feel this code may break more things than fix... |
|
|
||
| intersection.uv2 = Triangle.getInterpolation( _intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ); | ||
| intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ); | ||
| intersection.uv2 = intersection.uv1; // Backwards compatibility |
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.
Maybe add deprecation comment // @deprecated, r152 here?
| SpriteMaterial: 'sprite' | ||
| }; | ||
|
|
||
| function getChannel( value ) { |
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 still think this function would be simpler just as
return value === 0 ? 'uv' : `uv${ value }`;... Just as you did with the FBXLoader.
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.
Now that the ids are the same the code is more readable yes.
Related issue: #25788 #25938
Description
Before this PR we had this setup:
This PR renames the attributes to match GLTF ids and
material.channel:uv0uv