Skip to content
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

Unify type conversion functions in ShaderNode #23601

Merged
merged 6 commits into from
Mar 2, 2022
Merged

Unify type conversion functions in ShaderNode #23601

merged 6 commits into from
Mar 2, 2022

Conversation

LeviPesin
Copy link
Contributor

Related issue: -

Description

Unified type conversion functions in the ShaderNode.

@LeviPesin
Copy link
Contributor Author

LeviPesin commented Feb 28, 2022

Actually, maybe it is even better to move the code

if ( ( params.length === 1 ) && ( valueComponents !== 1 ) ) {

	// Providing one scalar value: This value is used for all components

	for ( let i = 1; i < valueComponents; i ++ ) {

		params[ i ] = params [ 0 ];

	}

}

to the corresponding .set() methods of different classes? E.g. make so that if Vector2.set() method is given one argument, it sets both components to that value (with something like if ( y === undefined ) { y = x }).

@sunag sunag self-assigned this Feb 28, 2022
@mrdoob mrdoob added this to the r139 milestone Feb 28, 2022
@sunag sunag merged commit 9bfae26 into mrdoob:dev Mar 2, 2022
@sunag
Copy link
Collaborator

sunag commented Mar 2, 2022

Thanks!!

@LeviPesin LeviPesin deleted the patch-2 branch March 2, 2022 19:09
@LeviPesin LeviPesin mentioned this pull request Mar 3, 2022
6 tasks
donmccurdy pushed a commit to donmccurdy/three.js that referenced this pull request Mar 10, 2022
* Unify type conversion functions in ShaderNode

* Add support for matrices

* Update ShaderNode.js

* Fix typo
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* Unify type conversion functions in ShaderNode

* Add support for matrices

* Update ShaderNode.js

* Fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants