Hi, I was wondering how to go about rotating the albedo texture of a triplanar material block. I already added position and scale handling in the attached playground + nme, but I am not sure what to do about rotation.
Maybe @Evgeni_Popov or @PatrickRyan would know ?
You can try to rotate the position before plugging it into the triplanar block:
Thanks for the reply! Just for clarity sake I will try to explain better what I am after. I am trying to add a behavior inside this tryplanar node material that behaves like the rotationW of a texture.
And indeed editing the position vector seems like itâs giving some results. I experimented with linking matrix building before writing this post. But gave up when I realized it might not actually be possible to construct a matrix starting from like a Float block that holds the âangleâ value and apply that to the mapping. Or, at least, I donât think itâs possible inside the node editor.
You can do it like this:
Wow, thank you for looking into this more! I cleaned up the material a bit and added the rotate feature for the other 2 axis as well. Babylon.js Node Material Editor
While testing it out I noticed some behaviors. https://playground.babylonjs.com/#9B0DNU#331
When rotating on only 1 axis (mesh box + angle input block on material), the face corresponding to axis renders correctly, but the other 2 are âfadedâ, even though they are correctly rotated.
When rotating on all 3 axis, things start looking not so good.
At this point my question is if you think itâs possible to have visually âcorrectâ mapping using this approach. I know this behavior can be alternated with just a standard material + tiling, but when the use case includes dynamic meshes with skeletons & bones, itâs not as easy.
I donât think itâs possible, unfortunately, given that the technique uses a single vector to fetch the pixel from the texture. It can work in special cases, but I donât think itâs possible to make it work in the general case.
One solution would be to add an angle input to the Triplanar block and apply a rotation based on this angle to the UV coordinates calculated internally by the block, before retrieving the texture. The result would be the same as if the texture had been rotated before being passed to the block. Would that work for you?
Result on a cube (angle is 45°):
And on a sphere:
One solution would be to add an angle input to the
Triplanarblock
YES! That would be excellent! Thank you!






