Confused by material maths (add node on 2 materials with stripes color+black gives plain color)

See the image attached, it explains everything.

I have 2 nodes:

  • top is white with black stripes
  • bottom is black with red stripes

The result I expected is white with red stripes ( 0,0,0 + 255,255,255 = 255,255,255 on white pixels, similar on red pixels ) but instead I’m getting a plain red.

Anyone would be so kind to explain me what is going on there? And how do I get my desired result out of this - white with red stripes?

I think the problem you’re seeing is because your vector parameters aren’t clamped to 0 when you subtract from them.

So when you’re doing RED (1,0,0) minus WHITE (1,1,1) you actually end up with RGB: 0,-1,-1.
Then when you add back WHITE (1,1,1) to (0,-1-1) you end up with RGB: 1,0,0 = RED.

So either clamp the output of “red minus white” node to 0 to 1 range, or just change it so you multiply the ColourEquator directly with GenerateOffsetBands in order to tint the bands before adding them.