Jump to content

clamping color


Recommended Posts

Hi!

I've been working on the stickies animation tutorial on the Side Effects website. In the tutorial, you create a simple animation in a COPS network. The animation consists of a red star and blue text moving across a yellow background. The animation is then imported to a series of grids in a SOP network by using the following expressions in a Point SOP:

pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CR) in the red channel

pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CG) in the green channel

pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CB) in the blue channel

My problem is that as the animation runs, I am getting some odd intermediate colors. For example, just before a yellow grid is turned blue by the text, it might turn green. I have played with the antialias values and the font details, which seemed to help a little bit. I have tried to clamp the color values like so:

clamp(pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CR),0,1)

clamp(pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CG),0,1)

clamp(pic("op:/obj/stickies/2danimation/comp_out",$BBX, $BBZ,D_CB),0,1)

That doesn't seem to work. Any suggestions? Basically, I need the colors to be on or off. When the colors are on, they are either blue or red. When they are off, they are yellow.

stickies_v03.hipnc

Link to comment
Share on other sites

I was really getting into figuring this out but I need to run! Often in many scripting languages there is a sort of "step" function that will interpolate without any smoothness. It will just jump from one value to the next. (RSL has this and its called "step" , but I was digging around and didn't find one for houdini yet...) I think if you could find this expression, that might solve it. Maybe. Good luck! Ill dig a bit some more after I get home again.

Link to comment
Share on other sites

The round function would work well if you are trying to get rid of the AA colors. Anything =>.5 is turned to 1 (or the next higher integer) and anything <.5 so put to 0. I use this technique in the animation section(page 3) of my Christmas lights tutorial to control some of the light animations while I am working with sin waves. Take a look, I try to explain how it all works in there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...