Procedural Texturing

Recently, while working on a level using procedural texturing, I wanted to add world mapping nodes (like WorldAlignedTexture and WorldAlignedNormal) to fix texture stretching issues. However, the main problem is that WorldAlignedTexture accepts a Texture Object instead of a Texture Sample, which limits the ability to pass sampled texture data.

Hi, the short answer for what you exactly want to do is that you can’t achieve what you want to do this way.

Long answer is that you may not have clearly understand what World Aligned Texture is doing. This function is doing a triplanar projection of your texture object, which means that it will sample it 3 times instead of one and merge the reult into a single vec3 result. So there is absolutely no way you can pass an already sampled pixel into that function or any other function.

This being said, there is actually another function named MF_Coordinate_Triplanar that will convert a world position into a triplanar UV projection directly. These output UV coords will then allow you to use them in a single texture sample, but the cost of that will be that the seams around 45° of each world axis planes will not be blended as a normal triplanar function would do but will be dithered instead. Which means that all the blended pixel results of your sampled texture will jump from one plane projection to another creating a weird superposition of the 2 or 3 planes blended together instead of mixing them into one single blended pixel.