POVRay Contour Line Texture

Can someone please tell me how can I do the following with a POVRay texture ...

//PseudoCode
texture {
    pigment {
        if(y mod 5 == 0) {
            color rgb 0
        } else {
            color rgb 1
        }
    }
}

those. - I want to get the equivalent of contour lines

+3
source share
1 answer

Why not use a simple gradient?

pigment {
  gradient y       
  color_map {
    [0.0  color rgb 0]
    [0.8  color rgb 0]
    [0.8  color rgb 1]
    [1.0  color rgb 1]
  }
  scale 5
}
+3
source

Source: https://habr.com/ru/post/1782867/


All Articles