Triplanar textures stretched on some slopes of my icosphere

Greetings everyone, I’m new to game dev and I’m running into a weird issue with triplanar texturing on my large procedural generated icosphere planet.

Here’s the HLSL I’m using:

GeoNormal = normalize(WorldPosition - PlanetCenter);

UVX = WorldPosition.yz / Scale; 
UVY = WorldPosition.xz / Scale; 
UVZ = WorldPosition.xy / Scale; 

float3 w = pow(abs(GeoNormal), BlendSharpness);
w = max(w, 0.001);
Weights = w / (w.x + w.y + w.z + 1e-6);

The issue is that textures are stretched on certain slopes depending on their orientation relative to the planet. Some slopes always appear stretched in one direction, even though the planet is fully spherical.

I’m trying to figure out how to make the texture scale uniform across all slopes while keeping smooth triplanar blending.

are you a bot? there’s a node for triplanar blending you don’t need custom hlsl.

1 Like

Thank you for your answer. I am not a bot (even though this is what a bot would probably also say ^^).

While i could use the WorldAlignedTexture node, it faces the same issues, as i do not have a plain flat where my terrain is located on but a lot of chunks arranged into an icosphere around a center point. So every Chunk has its own mesh pointing away from this center point

2 Likes

I don’t know if you’ve seen this guys method? ( procedural spherical UV )

I would just paste the material here, but I’m not at a machine rn…

1 Like

Thank you for your answer. I did not know about this method yet. I tried it and got it to work planet wide, but it suffers from stretching on all slopes differently when i would like to have the same scale for the textures for all of them. it also stretches a lot more the further it gets to the poles.

1 Like

If you ever find an answer, let me know. I don’t think there is one.. :wink: