When you add any position to the ground the textures are not correctly mixed.
I think worldNormal calculation, in vertex shader, is not right. Ignoring “world” seems to solve, but i’m not sure if this is a good solution. Any help?
Hi there and excuse me for bumping this old thread, but I have a related question (if new thread is needed, please tell me).
My question is: Does that fix mean triplanar textures can be in local space instead of world?
In DCCs like MAYA, projections have “local” mode, so with a unique projection (triplanar in this case) you get local transformations of it, like object translation, rotation and scale, so in the end the texture, even when it is a projection, sticks to each object perfectly, which is a must when there is animation involved.
You can do it with a node material with the new TriPlanar block, though. However, it does not (yet) allow 3 textures as inputs, so here’s a PR that fixes that:
Thank you @Evgeni_Popov for the info, I’ll check that.
For some reason I didn’t got any notification and didn’t noticed you answered, excuse me for my late answer.
Cheers.
Hi there @Evgeni_Popov
You say I can do this with NME, but I can’t figure it out (I’m not a coding guy by no means).
I did this, though.
What do I need to connect in order to make Triplanar work in local space?
You connected the mesh.position output to the TriPlanar position input, so you are using the local mesh position already. To use the world position you would need to connect the WorldPos output instead.
Note that you should remove the second unused FragmentOutput block.
Thank you for your help.
And now, how I connect PBR textures?
Should I use three triplanar nodes or is there a way to use ONE triplanar for that?
I ask that because having three nodes to do the same is kind of prone to human error, unless I can connect all three somehow and be able to have them synced
I have also used an additional triplanar block for the bump mapping. This way, it has the same functionalities than the regular triplanar material (but with the additional possibility to use local space).
You can change the textures programmatically using mat.getBlockByName():
Yes, you can plug up to three textures to the triplanar block for each axis, BUT I was referring to the textures needed for PBR shading, that is baseColor, ORM and normal textures.
So basically in the end you indeed need THREE triplanar blocks, one for each.
I hope triplanar material get an update and will be able to do PBR shading too.
Cheers.
Indeed, you need another triplanar block for the ORM texture, there’s no way around that.
I’m not sure what you expect from a triplanar PBR material that a node material couldn’t do?
In any case, there’s ~0 chance that the existing triplanar material will be updated to support PBR, it would be way too much work. Currently, it is not even up to the standard material, it uses its own shader that only does triplanar + shadows (so, no emissive, opacity, fresnel, refraction, etc that the standard material can do).
Note that the node material also has a BiPlanar block which uses only two textures instead of three. You may get some artifacts, depending on your geometry, but it may be worth a try.