World Aligned Coord instead of texture

Hi guys, I’m trying to create a Material Function so I can output a world UV coordinate so I can input that into textures. I know there’s a WorldAlignedTexture node, but that one needs a texture input and only works per texture, where I only need a coord so I can input that onto different textures.
I was able to tweak the WorldAlignedTexture and get one only to work on the Z axis (up) and pretty much stretch it on the other ones, here’s the node:

I tried to do the same with 2 axis, but it’s not working properly I think, and also on 45 degree faces it’ll warp the texture as it tried to average both directions, and I want to avoid that:

I tried with 3 axis as well, but that was a complete disaster. So my question is, how can do I do this? I need to pretty much be able to output and XY coord and XYZ coord so I can assign to textures like this:

215921-xyworldalignout.jpg

Thanks!

Texture coordinate, is a value, that points to which texel of a texture to show. You can’t smoothly blend UV coordinates, and expect to sample texture only once with that. You can select between RG, RB, GB texture projection based on respective channels of vertex normal, but the transition can only be a hard border between two.

Yes, that’s fine, the problem is that I can’t find a way to have all 3 axis and also make the transition a hard border with no falloff.

Well, you should first lerp between RB and GB coordinates based on vertex normal R channel, then lerp between result and RG coordinates based on vertex normal B channel, exactly same way as it is done inside WorldAlignedTexture material function