I'm working on a model to visually display information about a system. It is composed of multiple primitives, mostly spheres, cubes, and cones. In my previous modeling app (sadly no longer supported) I was able use a single "shader" on one subset of cubes, cones and spheres to give them all a certain look. Specifically, from the top, they would appear as if the had an "X" or "+" sign on them (eight color bands composed of two alternating colors that wrapped around each object from a vertex at the top to one on the bottom). From the side, the color bands would be vertical (like lines of longitude on a globe).
In Blender I can easily get what I want for cones and spheres, starting with a:
- Texture Coordinates node, connecting the "UV" output to a
- Mapping node (not really necessary since I don't change any defaults), connecting the vector output to
- the vector input on a Wave Texture node usings "rings", "Y", "sine", scale = 1.25 and all the other parameters set to zero, connected to
- a Color Ramp node set to "constant" and 0.500 (for sharp color separation), connected to
- a Mix Shader, also connected to two Principled BSDFs to provide the two different colors.
The problem is, when I use the same arrangement on a cube, it doesn't give me what I want at all. The top in particular is all wrong. The sides aren't quite right either.
I've tried changing the Texture Coordinates node to "Generated" instead of "UV," but that didn't work, and in fact I'm pretty sure I've tried every setting on that node without getting what I want. The Wave Texture node also works with "bands" and "X" instead of "rings" and "Y," but again that's only for spheres and cones.
I've spent a few hours on this and I still haven't found any way to do this. Basically I want to wrap the pattern around the cube as if it were a sphere. Or maybe it's more like cylindrical wrapping.
Am I missing something? Is there a simple way to do this? I do not want to use one shader for cones and spheres and another for cubes. To do that, I would have to sort through all the primitives to pick the cubes out from all the rest.