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

TextureNode: Introduce referenceNode #27986

Merged
merged 1 commit into from
Mar 24, 2024
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Mar 24, 2024

Description

It's allow that texture() sampler can be modified inside a function as parameter and preserve the root uniform as dynamic value. e.g:

const samplerNode = texture( map, uv() );

const otherUV = tslFn( ( [ tex ] ) => {

	const newSampler = tex.uv( viewportTopLeft ); // new sampler from TextureNode using as reference

	return newSampler;

} );

material.colorNode = otherUV( samplerNode );

// in loop

// this will update all instances (newSampler) created from samplerNode
samplerNode.value = otherMap;
@sunag sunag added this to the r163 milestone Mar 24, 2024
@sunag sunag marked this pull request as ready for review March 24, 2024 15:29
@sunag sunag merged commit 11e7114 into mrdoob:dev Mar 24, 2024
11 checks passed
@sunag sunag deleted the dev-referenceNode branch March 24, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant