-
-
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
Added Texture.DEFAULT_ANISOTROPY #25015
Conversation
Oh wait. I see @takahirox just suggested the same idea. :-) |
@@ -304,5 +304,6 @@ class Texture extends EventDispatcher { | |||
|
|||
Texture.DEFAULT_IMAGE = null; | |||
Texture.DEFAULT_MAPPING = UVMapping; | |||
Texture.DEFAULT_ANISOTROPY = 1; |
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.
Hm, why the case differs between Object3D.DefaultUp
/Object3D.DefaultMatrixAutoUpdate
and Texture.DEFAULT_IMAGE
/Texture.DEFAULT_MAPPING
/Texture.DEFAULT_ANISOTROPY
?
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'm not sure but I think @mrdoob lately stated his preference for this nomenclature. Unfortunately, I don't find the discussion right now.
For the time being, it's sufficient when we adhere to naming conventions per file. At a later point, we can unify the syntax.
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.
It probably should be Object3D.DEFAULT_UP
and Object3D.DEFAULT_MATRIXAUTOUPDATE
...
@LeviPesin Are these the only ones that would need to be changed?
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'm not sure but I think @mrdoob lately stated his preference for this nomenclature. Unfortunately, I don't find the discussion right now.
I think it was #23562.
@LeviPesin Are these the only ones that would need to be changed?
I think yes (static defaults are not used anywhere else, I think).
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 can make these changes for consistency if @mrdoob approves.
// from
Object3D.DefaultUp = /*@__PURE__*/ new Vector3( 0, 1, 0 );
Object3D.DefaultMatrixAutoUpdate = true;
Object3D.DefaultMatrixWorldAutoUpdate = true;
// to
Object3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 );
Object3D.DEFAULT_MATRIXAUTOUPDATE = true;
Object3D.DEFAULT_MATRIXWORLDAUTOUPDATE = true;
// from
Euler.DefaultOrder = 'XYZ';
Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ];
// to
Euler.DEFAULT_ORDER = 'XYZ';
Euler.RotationOrders // wait. why is this here? leave as-is -- or deprecate it?
// as-is
Texture.DEFAULT_IMAGE = null;
Texture.DEFAULT_MAPPING = UVMapping;
Texture.DEFAULT_ANISOTROPY = 1;
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.
Euler.RotationOrders // wait. why is this here? leave as-is -- or deprecate it?
I vote to remove it. Possible euler rotation orders should be clear without defining them in an array.
I've also thought about adding this change when reading #25010 but I'm afraid this opens the door for adding even more global defaults. Devs could argue to add the same for other parameters and it's hard to argue against this if we merge this PR. To me, I think the presented workaround in #25010 (comment) sounds sufficient. An additional traverse should not be noticeable in terms of loading time. |
Another solution may be...
|
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.
Okay, I'm convinced. The addition indeed make sense in this case.
Fixed #25010
Perhaps this is an acceptable solution...