# Show banding on object

I'd like to emphasisze the '3d-ness' of my object, by applying a rectangular mesh to it, as if it were a white object in a black room illuminated only by a (far away) laser that scans horizontal and vertical lines.

I manage to get as far as this picture:

Now, instead of the 'black' lines, i would like them to be solid green. And instead of the green gradients, it would be nice if these would be black.

Conceptually, what I'm looking for (I think I am): I'd like to tell the node editor something like:

if your input value is smaller then 0.9, output 0. If it is between 0.9 and 1, output 1.

How do I achieve this?

I used the following setup of my nodes:

My question looks a bit like: How to make a mesh look like it was 3D printed

• perhaps of interest: making-a-laser-in-cycles-straight-beam-of-light May 7 '15 at 7:38
• See blender.stackexchange.com/q/14394/599. Though I'd recommend zeffii's suggestion of actually illuminating the object with lights as you describe. After all, you have a light simulation engine. Why not use it? ;)
– gandalf3
May 7 '15 at 8:11
• That does the trick! Never thought of using the brick shader for this. May 7 '15 at 8:36
• @gandalf3 Would you mind turning your comment into an answer? May 7 '15 at 8:52

here's a grid OSL shader I wrote a while back.

/*
Grid Lines
: Author Dealga McArdle, 2013
: modified from Sine Stripes by Thomas Dinges

*/

#include "stdosl.h"

// input and output parameters
vector Vector = P,
color GridColor = color(0.8),
float Intensity = 1.0,
float Distance_U = 0.02,
float Distance_V = 0.02,
int Stripes_U = 10,
int Stripes_V = 10,
output float Fac = 1.0,
output color Color = color(0.8),
float World_X = 1.0,
float World_Y = 1.0
)
{

point Pos = Vector;
Pos[0] -= World_X;
float pattern_col = 0.0;

for(int i = 0; i < Stripes_U; ++i ) {
Pos[0] += Distance_U;
pattern_col += abs(Intensity / Pos[0] / 1000.0);
}

Pos = Vector;
Pos[1] -= World_Y;
for(int i = 0; i < Stripes_V; ++i ) {
Pos[1] += Distance_V;
pattern_col += abs(Intensity / Pos[1] / 1000.0);
}

color C = transformc("hsv", GridColor);

Fac = pattern_col;
Color = color("hsv", C[0], C[1], (Fac*C[2]));
}


It generates a grid of black vs some user defined colour. There are many ways to use it, but to get a feel for it I suggest sticking it as a material on a Plane, and see what the sliders do.

If you add a Suzanne, you could set the Stripes U and V to 1 so there's only one grid line, then animate the Distance X between the extents of your object., and you'll get the laser scan effect. Or animate the WORLD X,Y as they are the center of the shader's coordinate system.

Looks like this

It's a grid osl, therefore capable (and intended) to make grids.

### Alternatively, xyz banding

remove the axis you don't need. You can offset the Geometry position by some vector amount if the missing Axis band (0,0,0) bothers you

• That's extremely cool! May 7 '15 at 8:51
• Yeah, too many solutions for some problems :) May 7 '15 at 9:29
• I like the last answer the most. I used it my own answer, although I marked yours as THE answer. √ May 7 '15 at 11:41

This is how it looks after using @gandalf3 suggestion: (bricks)

And here's a screenshot using @zeffii answer, which I marked as "THE" answer, because it elaborated on my own, initial approach. I include it in my answer, because I changed some settings in the nodes that might be of interest to others:

Changes:

1. turn 'less than' into 'Greater than'.
2. Add the X, Y and Z into one value and put this into a CombineRGB --> only green lines
3. There are two 'value' nodes in the original answer. I combined the into one, where I calculate the value of the second from the first one.