Download

Inverting Colors Inside a Material?

I’m attempting to write a material that will invert any color inside it, but I’m not sure where to start. For instance, half of that red cube should be inverted to blue once it enters the space of the material. I would assume it has something to do with modulating (blend type)? If anyone could give any assistance, I would be appreciative.

So… once it enters the space.
I’m assuming you know what post processes are and how they work? They would be perfect for this as you can take in the base color, and do whatever with it, altering the way the object looks.

You woudlnt do something like this on a material shader because you’d need to keep track of the object location and a world location. But. Say you wanted to…

Make a sphere mask, use parameters so you can control the location in instance. (World location 0,0,0, probably).
Use the sphere mask output in a lerp, and lerp 2 colors.

If you are asking how to invert a color, usually, you 1- the thing.