-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Texture: Add WorldMapping to use world coordinates for texturing (#18992) #19010
Conversation
Thanks for adding a live link. I'm in the process of adding my build from this PR to my application to see if it actually solves my problem 😉. There seems like there might be an issue so hold off on merging for now. Comments are welcome though. |
Okay, after some fixes, there are no remaining issues with my app. This is mergable AFAIK 😄 |
see #18992 (comment) |
see #18992 (comment), in response to previous comment |
I agree that this is application specific and doesn't belong in core -- I think node materials or ShaderMaterials serve this use case well. |
Okay, let's close this and finalize discussion in the issue. |
Removed temporary live link. |
This PR adds
THREE.WorldMapping
, an alternative toTHREE.UVMapping
.WorldMapping
works by using two (user defined) axes of the vertex's world coordinates as the UV coordinates for texture mapping. It is configurable via the API:This is crucial for applying "seamless" textures to grids of non-square objects without manually setting the UVs of each one. As a result,
InstancedMesh
is supported.The changes don't break any of the examples I tried running.
A working example is available:
webgl_materials_texture_worldmapping
Please see #18992 for more details.
Warning: This is my first PR on this repository and the biggest PR I have ever written for any repository. It may break things. Please merge with caution. Suggestions for changes/fixes welcome.