Hi all,
while developing our landscape material I did a little test between using AbsoluteWorldPosition and using LandscapeLayerCoords for the UVs on the landscape. Before the test I was 100% certain that using the LandscapeLayerCoords node for UVs would be faster since it was specifically made for landscapes, but to my surprise, the Shader Complexity went up a bit compared to using AbsoluteWorldPosition.
Is there any reasons (other than to match a mask 1:1 on the landscape) to use LandscapeLayerCoords? If I just want to tile ground textures over the landscape, am I better of using AbsoluteWorldPosition or TexCoord instead of LandscapeLayerCoords? What is the performance difference between all 3?
bump…
i would like to know this as well. Currently I am using planar projection instead of landscape coord. This way I am also able to blend other non landscape objects.
What if you try doing the landscape coords on the custom UVs? I am not sure if it would work but it might.
As far as why is there a cost difference, it is most likely because there are a few ALU instructions to map from regular worldpos to coordinates matching the landscape size. Worldposition itself is basically free since the hardware is already doing it for a number of other reasons, so anything else you do to modify the coordinates will cost something unless you actually store the data somewhere like baking it into the UVs. Moving the calculations to the CustomUVs would do the extra calculations on the vertex shader which should be almost like its free.
If you use origin shifting, then won’t the texture move when the origin shifts if you use “absolute” texture coordinates?
(And if it doesn’t, precision will kill you a bit out from the origin.)