PDA

View Full Version : ISub clips negative colors at zero


jfrancis
07-20-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 http://www.digitalartform.com/archives/2004/10/smear_now_or_sm.html in shake)

jeremybirn
07-20-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?

-jeremy

Hugh
07-20-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.

jfrancis
07-31-2005, 04:04 PM
Thanks!

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:

http://www.digitalartform.com/archives/2005/07/uv_map_now_or_u.html

CGTalk Moderation
07-31-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.