I've been experimenting with node-based procedural materials in Cycles lately, and after spending a few hours working out a brick material that works pretty well along walls, I noticed that it has a few issues. Here's my initial setup:
It's not perfect, since it switches the different orientations in an all-or-nothing way, but for my purposes, it looks good enough.
So I went ahead and used this throughout my test scene. But then I turned the camera around and looked at the other side, and... there's something wrong with the side of the cube facing away on the X axis!
This isn't a huge issue, because I don't plan to render my objects from that angle, but I'm concerned about the way it will affect reflections, light bounces, etc. so I started looking around for other solutions. I happened on this thread at Stack Exchange: How to create a procedural brick texture for a simple building without object size changing the texture size?
Particularly, Rich Sedman's answer seemed promising (since I'm trying to avoid using UV mapping). Following what he posted, I created this:
This new setup works great for the cube - on every side - but you can see pretty plainly that the cylinder, strangely, has problems. By the way, there is a part of the node setup that I omitted from the screenshot that isn't really relevant here - it checks the Z value of the geometry surface and subs in the default vectors for the texture coordinates if Z is over a certain amount, for sides that face upward.
I've been experimenting with this for a few more hours now, but I'm afraid I've reached my limits in terms of vector math.
Is there anything obvious I'm missing here that might help fix this, and make this setup work for both the cube and cylinder?