-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Adding triplanar mapping #15048
Comments
Sounds good to me. Should it be |
Actually, it may be tricky to implement in the current material/texture API design, but maybe it's easier in the node material design? /ping @sunag |
Certainly is more easier creating a node for this... and follow the code bellow |
Maybe something like: var tex = new THREE.TriplanarTextureNode( texture, uv ); |
The approach of the video would be something like:? var uvModelScale = new THREE.OperatorNode(
new THREE.UVNode(),
new THREE.Vector3Node( model.scale ),
THREE.OperatorNode.MUL
); |
I've implemented it in the THREE shader chunks (the video), for every map type there is just simple #ifdef either using This technique uses the planes of all axes and a texture sample per axis and blends them by the normal. All core changes it required where in the WebGLRenderer.js |
Since there is a node example demonstrating triplanar mapping, this issue can be closed. This approach will also be possible with the new material system. |
@Mugen87 Hi Michael, I could not see the triplanar example you are talking about, Could you please clarify? Thanks |
The mentioned example is not available anymore since it depended on the "old" node material which was removed with |
This would be a useful feature to have by default, besides terrains, when sculpting shapes or using primitives to construct a scene. It currently requires to generate a geometry with proper UV coordinates.
I'd suggest local and global mapping, since organic textures work fine for mixed axes and will then seamlessly mix with intersecting objects.
I've implemented it with a mapping property on the material which is by default
THREE.UVMapping
, insetProgram
i set amodelScale
uniform for local mapping.https://mevedia.com/img/triplanar.mp4
The text was updated successfully, but these errors were encountered: