View Full Version : ISub clips negative colors at zero

07 July 2005, 01:48 AM
Must ISub clip negative colors at zero internally?

I understand clipping to 0 at output, but in the middle of my tree?

I'm trying to do something with image differences controlling displacements and I can't use ISubA -- I need the negative numbers to be offsets in the other direction.

(I'm trying to do this in shake)

07 July 2005, 03:28 AM
Hm... How negative to they go? Could you just add a constant to all of them to make them all positive, use the node, then subtract the constant right afterwards? Or do you need to split it into positive and negative values and negate one of them so they both are positive when they are operated on?


07 July 2005, 09:40 AM
What bit-depth are you working at?

In 8-but and 16-bit, there is no such thing as less than 0 or greater than 1 - if you convert to float before doing your ISub, you should find that you get negative values.

07 July 2005, 04:04 PM

I didn't realize I had to explicitly cast to float with a byte node; I assumed everything was promoted to float internally as a matter of course.

Finished product:

CGTalk Moderation
07 July 2005, 04:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.