• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/9

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

9 Cards in this Set

  • Front
  • Back
Inverting a value (0,1)

Inverting a value (-1, 1)
Subtract the input by 1.
y = x --> y = 1 - x

Multiply by -1
y = x --> y = -x
Signing a value
aka "signing"
Sometimes you need to change 0 to 1 to -1 to +1.
Multiply the value by 2 and then subtract 1.
y = (2*x) -1
- USED FOR: Noise functions
Divide Value by 0
you multiply the s and t values by 1/txscale. This scales down the texture coordinates, making the texture file itself appear to scale UP. To prevent divide by zero, use the max() shadeop to restrict the value to drop to some very small number.

float scalar = max(1/txscale,0.000001);
float ss = s * scalar;
float tt = t * scalar;
Parameterizing a value
aka Parameterization
Ex: A shader artist will try values between 0 to 10 but you (the designer), know that the best values lie between 20-45. We must change 20-45 so it becomes a linear interpolation to 0-10.

- Subtract the low value (20) from the high value (45) and then multiply that value by the user input (x) and add the low value (20) back into the result.

#define parameterize(x,lo,hi) lo + x * (hi – low)
float specval = parametrizeVal(specParam,20,45);
float phongValue = (phong(N,I,specVal);
Bias
Manipulate between 0 to 1 without modifying the low or high value.
- Default value of 0.5
- A weight modifier. It controls which part of 0 to 1 has more weight

EX:
float bias(varying float val,b){
return (b > 0) ? pow(val,log(b) / log(0.5)): 0;
}
Gain
Manipulate between 0 to 1 without modifying the low or high value.
- Default value of 0.5
- A contrast function. It leaves 0, 0.5, and 1 alone and manipulates 0 - 0.5 and 0.5 - 1 as two separate segments.
Gamma
float
- To apply to a color, it must be applied to every channel
- Base function: y = pow(x,1/gammavalue)


#define gamma(x,value) pow(x,1/value)
color col1 = color (0.5,0.5,0.5);
color gammacol1 = color(gamma(comp(col1,0),gammaval),
gamma(comp(col1,1),gammaval),
gamma(comp(col1,2),gammaval);
Compression and Expansion
"Tabling" and "Walling" a color curve
- Changes min/max values
Remapping
float
A "fit operation" - similar to parameterizing values.
Takes the low and high values of x (referred to as a1 and b1) and fits them in a linear fashion into a new low and high value

- If you call remap(x,1,1,0), the value of x will be inverted
- CAN'T GO BELOW/ABOVE THESE VALUES
- Takes more memory to use because it is a function!