Jump to content

What's the difference between these inner codes in VOPs?


Recommended Posts


While looking at some of the built-in VOPs, I noticed some of their inner code has code like this:

#if !strcmp($signature, "v4")
float $cr = vop_bias($val.x, $amount.x);
float $cg = vop_bias($val.y, $amount.y);
float $cb = vop_bias($val.z, $amount.z);
float $ca = vop_bias($val.w, $amount.w);
$bias = set($cr, $cg, $cb, $ca);[/CODE]

while others have:

float $tt, $dbias;
$dbias = vop_FilterWidth($bias);
$tt = FILTERSTEP($thresh12, $bias - $dbias - $blur12, $bias + $dbias + $blur12, $filter);
$tt += FILTERSTEP($thresh23, $bias - $dbias - $blur23, $bias + $dbias + $blur23, $filter);
if ($tt > 1) $blend = lerp($region2, $region3, $tt-1);
else $blend = lerp($region1, $region2, $tt);[/CODE]

Do #if, #else instead of if, else allow conditional compilation?

Is it possible to have a VEX function that won't be called if a particular argument has a certain value?


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.

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...