Skip to content

Added THREE.Sampler.#22838

Closed
Mugen87 wants to merge 1 commit intomrdoob:devfrom
Mugen87:dev17
Closed

Added THREE.Sampler.#22838
Mugen87 wants to merge 1 commit intomrdoob:devfrom
Mugen87:dev17

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Nov 15, 2021

Related issue: see #17949 (comment)

Description

I've used the last few days to think about an implementation of THREE.Sampler. The idea is to have a class above THREE.Texture that controls the uv transformation.

Technically, THREE.Sampler just manages the uniform uvTransform. The related properties and methods are moved from THREE.Texture to THREE.Sampler.

Since map properties can now hold THREE.Texture or THREE.Sampler, the texture related code is now a bit more complex. Especially the serialization/deserialization logic. It would be cleaner if the THREE.Sampler -> THREE.Texture composition would be mandatory. However, I don't think it's possible to make this change with the engine's maturity level.

I did not add any legacy warnings nor tested all examples yet. Just want to hear everybody's opinion about the current design. After this iteration, the PR can be refined.

The example webgl_raycast_texture has already been updated to use THREE.Sampler.

@Mugen87 Mugen87 marked this pull request as draft November 15, 2021 16:21
@mrdoob
Copy link
Copy Markdown
Owner

mrdoob commented Nov 15, 2021

I did not think about the serialization part. This is indeed much harder than #17949...

Many thanks for exploring the idea though! 🙏

@Mugen87
Copy link
Copy Markdown
Collaborator Author

Mugen87 commented Feb 1, 2022

Closing in favor of #22846.

@Mugen87 Mugen87 closed this Feb 1, 2022
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.

2 participants