I hope you guys are doing well. I have a question that I’ve been looking for quite a while and haven’t found a definitive answer to it.
I’m curious about the usage of World Aligned / Triplanar textures. While I understand they can be expensive, I would like to have a better understanding for when this technique can be appropriate to be used.
Let me give you the proper context: I’m currently developing a cliff material intended for use in a real-time environment. Given the scale and stylistic requirements of said cliffs, traditional UV unwrapping doesn’t seem to give me the desired results (At least not for everythin). Also, TexelSize can be a problem since these assets will be scaled up and down quite a lot. Not only that, It’s crucial that the cliffs feature stylized cracks and blend when multiple meshes are joined togheter, creating the illusion of a single cohesive cliff. Besides that, the character will be able to get very close to these objects, so the resolution must be kept at least in some part of the material.
For the crack material setup, I’ve been using 2 WorldAlignedNormals and 1 WorldAlignedTexture. The World Aligned normals is being used twice so I can blend between a far away version and a close up version of said cracks. Additionally, I’m utilizing the B channel of the normal map to incorporate a “Moss Map” near the cracks. Furthermore, I’ve implemented another WorldAlignedTexture to generate masks to ensure the tiling on both cracks and moss are broken (R channel is for Cracks and G and B are for the Moss).
Here’s an image of the current progress using placeholder textures:
In addition to the World Aligned Texture Samples, the material includes a Base Color, a Regular Normal Map, and an ORM map.
My question is whether the number of texture samples utilized in this setup is considered excessive for this type of material. Is it acceptable or should I explore alternative techniques to achieve similar results?
I appreciate any insights or suggestions you may have on this matter. Thanks in advance.
World aligned texturing is expensive, specifically the way it is implemented in the built-in functions in Unreal. This is because each one has to do 3 texture samples, meaning you’re doing 9 samples for this material.
Honestly, it’s probably fine as long as you aren’t applying it to everything or trying to blend many sets of world aligned textures together (landscape materials are infamous for doing this) but at the end of the day what is “too expensive” depends heavily on your target platform, which you will need to profile for.
If you do decide to look elsewhere, I would suggest dithered blending of UVs. This allows you to do triplanar/world aligned texturing in a single texture sample. The sampling costs more but I’ve been told it is meaningfully faster than doing 3 samples.
Honestly, it’s probably fine as long as you aren’t applying it to everything or trying to blend many sets of world aligned textures together (landscape materials are infamous for doing this) but at the end of the day what is “too expensive” depends heavily on your target platform, which you will need to profile for.
The idea is to use it only on cliffs and maybe rocks to make them blend better together and the usage would be limited to this specific case. Regarding the Target Platform, we don’t have a specific target hardware yet (But it’s for PC. The hardware Minimum Requirement is something closer to a GTX 1650 and 8 Gb RAM for now).
If you do decide to look elsewhere, I would suggest dithered blending of UVs. This allows you to do triplanar/world aligned texturing in a single texture sample. The sampling costs more but I’ve been told it is meaningfully faster than doing 3 samples.
I’ve tried other solutions like the 1 sample triplanar:
Even though it worked at first, I found it tricky to implement without any issues compared to the more straight forward method available in UE4/UE5 by default. It tends to break when I try to calculate the B channel through shader or do other shenanigans.
Either way, I managed to find some videos explaining the method better and could get similar results with less texture samples. I would like to thank you for the article. It cleared a lot of questions I had prior to this.