# Is it possible to use geometry normal to make textures using geometry position to face normal rotation

I am attempting to make a semi-procedural material that is intended for use in walls. To ensure proper tiling of the texture, I intended to use geometry position as the vector and normal as the rotation, which just gave me the same weird streaks as just position. I spent a good while separating out each cardinal direction using comparisons between x & y as a mask. This sort of worked, but resulted in slightly stretched textures on the diagonals.

I figured this was fine, but as I worked, I found that due to the rotation of the texture mapping, the normal maps were facing the wrong direction, so that the face was lit at odd angles and rarely when the light was straight on.

I tried to use vector rotation on each cardinal to correct the issue, but it seemed that each face had a different rotation offset, making it impossible to correct without rotating literally every face, defeating the purpose of the material.

So, my question is; is there an easier way to do this that does not require UV mapping? Or is this simply an impossible endeavor?

• Check this answer from @Rich Sedman .. it talks about the Bricks procedural, but should apply to any 2D texture? – Robin Betts Oct 9 '20 at 8:16
• ... Having just tried it myself, I think you may have to multiply the X component (on the way into the Combine XYZ which gives the texture's Vector) by -1. – Robin Betts Oct 9 '20 at 8:46
• Indeed triplanar mapping is what you are looking for – Iyad Ahmed Oct 9 '20 at 9:42
• The triplanar method from the post Robin referenced does definitely clean up the nodes, but it still results in mangled normals. I'm going to try and correct it with this new method to see if that changes anything – Tyree Bingham Oct 10 '20 at 8:41
• For anyone who runs across this question, this article has some really good information about triplanar mapping and how to overcome various problems you might face while implementing it. It'll be a pain to do it with blender nodes, though, as it's all done in C#. – Tyree Bingham Oct 11 '20 at 4:59