World Aligned XYZ Material without Texture Objects?

I’m currently working on a material that uses several detail textures that need to be tiled in XYZ world coordinates. The problem is, all of the default functions require me to input a texture object. The detail textures I’m using are DXT5 normals with Roughness and Greyscale Albedo maps packed into the Blue and Alpha channels. This obviously wouldn’t work if I converted them to texture objects.

Ideally, I would be able to project texture samplers into XYZ world coordinates. Any ideas?

That is not how texture samplers work. When you look up a texture sample, you only have access to the value of the texture at the specified UV for the pixel being currently rendered. If you want to look up another location, that requires another lookup. Because triplanar mapping uses 3 planes, this means you need 3 samples. And the UVs need to be specified correctly for each sample. Texture Objects are required since they pass a reference to the texture and the function can perform the lookups it needs.

There should be nothing wrong with doing channel packing using world aligned textures. Just do a component mask at the end and extract your channels as usual, and pretend the world aligned part is not there. Make sure to check UseFloat4 if you need alpha.

1 Like

Yep, that did the trick. Thanks for the quick response!

I am looking for an answer to the above question, but I do not quite understand RyanB’s answer. If you have resolved this issue, can you show a screenshot of the node?

I have found the solution to this by just messing around long enough. What you want to do is: Instead of a TextureSample, you’ll have TextureObject>WorldAlignedTexture>ComponentMask. I assume you would just use multiple component masks if you needed separate color outputs. Screenshot attached of how I replaced my TextureSample with this.