Ok, so I used a normal map texture that I feed trough the triplanarMapping function modified as follow:
// Triplanar mapping
vec2 uvX = position.yz * scale;
vec2 uvY = position.zx * scale;
vec2 uvZ = position.xy * scale;
// Normals
vec3 normalX = (vec3(texture2D(texture, uvX)) * 2.0 - 1.0) * blend.x;
vec3 normalY = (vec3(texture2D(texture, uvY)) * 2.0 - 1.0) * blend.y;
vec3 normalZ = (vec3(texture2D(texture, uvZ)) * 2.0 - 1.0) * blend.z;
return normalize((normalX + normalY + normalZ) / 3.0);
Is it what you meant? Result seems to be plausible when I tested