Inversion expression

What is the correct syntax for this? Let’s say I want to pass the R color of one node to the R color of another node, but inverted?

Code:


float $rampR = ramp1.outColorR;
surfaceShader1.outColorR = inverted $rampR;


in regular math inversion seems to be 1/x but with color numbers this would not work because 1/1 = 1 (which should be zero for black) and 1/0 = 0 (which should be 1 for white)

thanks

No Responses to “Inversion expression”

Post a Comment