GPU Core
GPU defines and functions.
Functions
Return type |
Description |
---|---|
ffxSqrt (FfxFloat32 x)
Compute the square root of a value.
|
|
ffxSqrt (FfxFloat32x2 x)
Compute the square root of a value.
|
|
ffxSqrt (FfxFloat32x3 x)
Compute the square root of a value.
|
|
ffxSqrt (FfxFloat32x4 x)
Compute the square root of a value.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the min of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the max of two values.
|
|
Compute the value of the first parameter raised to the power of the second.
|
|
Compute the value of the first parameter raised to the power of the second.
|
|
Compute the value of the first parameter raised to the power of the second.
|
|
Compute the value of the first parameter raised to the power of the second.
|
|
Copy the sign bit from ‘s’ to positive ‘d’.
|
|
Copy the sign bit from ‘s’ to positive ‘d’.
|
|
Copy the sign bit from ‘s’ to positive ‘d’.
|
|
Copy the sign bit from ‘s’ to positive ‘d’.
|
|
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
|
|
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
|
|
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
|
|
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
|
|
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
|
|
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
|
|
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
|
|
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
|
|
ffxFloatToSortableInteger (FfxUInt32 value)
Convert a 32bit floating point value to sortable integer.
|
|
ffxSortableIntegerToFloat (FfxUInt32 value)
Convert a sortable integer to a 32bit floating point value.
|
|
ffxApproximateSqrt (FfxFloat32 value)
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateReciprocal (FfxFloat32 value)
Calculate a low-quality approximation for the reciprocal of a value.
|
|
Calculate a medium-quality approximation for the reciprocal of a value.
|
|
Calculate a low-quality approximation for the reciprocal of a value.
|
|
ffxApproximateSqrt (FfxFloat32x2 value)
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateReciprocal (FfxFloat32x2 value)
Calculate a low-quality approximation for the reciprocal of a value.
|
|
Calculate a medium-quality approximation for the reciprocal of a value.
|
|
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateSqrt (FfxFloat32x3 value)
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateReciprocal (FfxFloat32x3 value)
Calculate a low-quality approximation for the reciprocal of a value.
|
|
Calculate a medium-quality approximation for the reciprocal of a value.
|
|
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateSqrt (FfxFloat32x4 value)
Calculate a low-quality approximation for the square root of a value.
|
|
ffxApproximateReciprocal (FfxFloat32x4 value)
Calculate a low-quality approximation for the reciprocal of a value.
|
|
Calculate a medium-quality approximation for the reciprocal of a value.
|
|
Calculate a low-quality approximation for the square root of a value.
|
|
Calculate dot product of ‘a’ and ‘b’.
|
|
Calculate dot product of ‘a’ and ‘b’.
|
|
Calculate dot product of ‘a’ and ‘b’.
|
|
Compute an approximate conversion from PQ to Gamma2 space.
|
|
Compute an approximate conversion from PQ to linear space.
|
|
Compute an approximate conversion from gamma2 to PQ space.
|
|
Compute a more accurate approximate conversion from gamma2 to PQ space.
|
|
Compute a high accuracy approximate conversion from gamma2 to PQ space.
|
|
Compute an approximate conversion from linear to PQ space.
|
|
Compute a more accurate approximate conversion from linear to PQ space.
|
|
Compute a very accurate approximate conversion from linear to PQ space.
|
|
Compute an approximate conversion from PQ to Gamma2 space.
|
|
Compute an approximate conversion from PQ to linear space.
|
|
Compute an approximate conversion from gamma2 to PQ space.
|
|
Compute a more accurate approximate conversion from gamma2 to PQ space.
|
|
Compute a high accuracy approximate conversion from gamma2 to PQ space.
|
|
Compute an approximate conversion from linear to PQ space.
|
|
Compute a more accurate approximate conversion from linear to PQ space.
|
|
Compute a very accurate approximate conversion from linear to PQ space.
|
|
Compute an approximate conversion from PQ to Gamma2 space.
|
|
Compute an approximate conversion from PQ to linear space.
|
|
Compute an approximate conversion from gamma2 to PQ space.
|
|
Compute a more accurate approximate conversion from gamma2 to PQ space.
|
|
Compute a high accuracy approximate conversion from gamma2 to PQ space.
|
|
Compute an approximate conversion from linear to PQ space.
|
|
Compute a more accurate approximate conversion from linear to PQ space.
|
|
Compute a very accurate approximate conversion from linear to PQ space.
|
|
Compute an approximate conversion from PQ to Gamma2 space.
|
|
Compute an approximate conversion from PQ to linear space.
|
|
Compute an approximate conversion from gamma2 to PQ space.
|
|
Compute a more accurate approximate conversion from gamma2 to PQ space.
|
|
Compute a high accuracy approximate conversion from gamma2 to PQ space.
|
|
Compute an approximate conversion from linear to PQ space.
|
|
Compute a more accurate approximate conversion from linear to PQ space.
|
|
Compute a very accurate approximate conversion from linear to PQ space.
|
|
Conditional free logic AND operation using values.
|
|
Conditional free logic AND operation using two values.
|
|
Conditional free logic AND operation using two values.
|
|
Conditional free logic AND operation using two values.
|
|
Conditional free logic NOT operation using two values.
|
|
Conditional free logic NOT operation using two values.
|
|
Conditional free logic NOT operation using two values.
|
|
Conditional free logic NOT operation using two values.
|
|
Conditional free logic OR operation using two values.
|
|
Conditional free logic OR operation using two values.
|
|
Conditional free logic OR operation using two values.
|
|
Conditional free logic OR operation using two values.
|
|
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
|
|
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
|
|
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
|
|
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
|
|
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
|
|
Given a value, returns 1.0 if greater than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if greater than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if greater than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if greater than zero and 0.0 if not.
|
|
Conditional free logic signed NOT operation using two FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two FfxFloat32 values.
|
|
Conditional free logic signed NOT operation using two FfxFloat32 values.
|
|
Conditional free logic OR operation using two FfxFloat32 values.
|
|
Conditional free logic OR operation using two FfxFloat32 values.
|
|
Conditional free logic OR operation using two FfxFloat32 values.
|
|
Conditional free logic OR operation using two FfxFloat32 values.
|
|
Choose between two FfxFloat32 values if the first paramter is greater than zero.
|
|
Choose between two FfxFloat32 values if the first paramter is greater than zero.
|
|
Choose between two FfxFloat32 values if the first paramter is greater than zero.
|
|
Choose between two FfxFloat32 values if the first paramter is greater than zero.
|
|
Given a value, returns 1.0 if less than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if less than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if less than zero and 0.0 if not.
|
|
Given a value, returns 1.0 if less than zero and 0.0 if not.
|
|
ffxRec709FromLinear (FfxFloat32 color)
Compute a Rec.709 color space.
|
|
ffxRec709FromLinear (FfxFloat32x2 color)
Compute a Rec.709 color space.
|
|
ffxRec709FromLinear (FfxFloat32x3 color)
Compute a Rec.709 color space.
|
|
ffxLinearFromRec709 (FfxFloat32 color)
Compute a linear value from a REC.709 value.
|
|
ffxLinearFromRec709 (FfxFloat32x2 color)
Compute a linear value from a REC.709 value.
|
|
ffxLinearFromRec709 (FfxFloat32x3 color)
Compute a linear value from a REC.709 value.
|
|
Compute a gamma value from a linear value.
|
|
Compute a gamma value from a linear value.
|
|
Compute a gamma value from a linear value.
|
|
Compute a linear value from a value in a gamma space.
|
|
Compute a linear value from a value in a gamma space.
|
|
Compute a linear value from a value in a gamma space.
|
|
ffxPQFromLinear (FfxFloat32 value)
Compute a PQ value from a linear value.
|
|
ffxPQFromLinear (FfxFloat32x2 value)
Compute a PQ value from a linear value.
|
|
ffxPQFromLinear (FfxFloat32x3 value)
Compute a PQ value from a linear value.
|
|
ffxLinearFromPQ (FfxFloat32 value)
Compute a linear value from a value in a PQ space.
|
|
ffxLinearFromPQ (FfxFloat32x2 value)
Compute a linear value from a value in a PQ space.
|
|
ffxLinearFromPQ (FfxFloat32x3 value)
Compute a linear value from a value in a PQ space.
|
|
ffxSrgbFromLinear (FfxFloat32 value)
Compute an SRGB value from a linear value.
|
|
ffxSrgbFromLinear (FfxFloat32x2 value)
Compute an SRGB value from a linear value.
|
|
ffxSrgbFromLinear (FfxFloat32x3 value)
Compute an SRGB value from a linear value.
|
|
ffxLinearFromSrgb (FfxFloat32 value)
Compute a linear value from a value in a SRGB space.
|
|
ffxLinearFromSrgb (FfxFloat32x2 value)
Compute a linear value from a value in a SRGB space.
|
|
ffxLinearFromSrgb (FfxFloat32x3 value)
Compute a linear value from a value in a SRGB space.
|
|
A remapping of 64×1 to 8×8 imposing rotated 2×2 pixel quads in quad linear.
|
|
A helper function performing a remap 64×1 to 8×8 remapping which is necessary for 2D wave reductions.
|
Macros
Name |
Description |
---|---|
FFX_FALSE (false) |
A define for a false value in a boolean expression.
|
FFX_NEGATIVE_INFINITY_FLOAT ffxAsFloat(0xff800000u) |
A define value for negative infinity.
|
FFX_PI (3.14159) |
A define value for PI.
|
FFX_POSITIVE_INFINITY_FLOAT ffxAsFloat(0x7f800000u) |
A define value for positive infinity.
|
FFX_TRUE (true) |
A define for a true value in a boolean expression.
|
Detailed description
GPU defines and functions.
Global functions
ffxSqrt
FfxFloat32 ffxSqrt (FfxFloat32 x)
Compute the square root of a value.
Parameters:
x |
The first value to compute the min of. |
Returns:
The the square root of x
.
ffxSqrt
FfxFloat32x2 ffxSqrt (FfxFloat32x2 x)
Compute the square root of a value.
Parameters:
x |
The first value to compute the min of. |
Returns:
The the square root of x
.
ffxSqrt
FfxFloat32x3 ffxSqrt (FfxFloat32x3 x)
Compute the square root of a value.
Parameters:
x |
The first value to compute the min of. |
Returns:
The the square root of x
.
ffxSqrt
FfxFloat32x4 ffxSqrt (FfxFloat32x4 x)
Compute the square root of a value.
Parameters:
x |
The first value to compute the min of. |
Returns:
The the square root of x
.
ffxMin
FfxFloat32 ffxMin (FfxFloat32 x, FfxFloat32 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxFloat32x2 ffxMin (FfxFloat32x2 x, FfxFloat32x2 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxFloat32x3 ffxMin (FfxFloat32x3 x, FfxFloat32x3 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxFloat32x4 ffxMin (FfxFloat32x4 x, FfxFloat32x4 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxInt32x2 ffxMin (FfxInt32x2 x, FfxInt32x2 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxInt32x3 ffxMin (FfxInt32x3 x, FfxInt32x3 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxInt32x4 ffxMin (FfxInt32x4 x, FfxInt32x4 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxUInt32x2 ffxMin (FfxUInt32x2 x, FfxUInt32x2 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxUInt32x3 ffxMin (FfxUInt32x3 x, FfxUInt32x3 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMin
FfxUInt32x4 ffxMin (FfxUInt32x4 x, FfxUInt32x4 y)
Compute the min of two values.
Parameters:
x |
The first value to compute the min of. |
y |
The second value to compute the min of. |
Returns:
The the lowest of two values.
ffxMax
FfxFloat32 ffxMax (FfxFloat32 x, FfxFloat32 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxFloat32x2 ffxMax (FfxFloat32x2 x, FfxFloat32x2 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxFloat32x3 ffxMax (FfxFloat32x3 x, FfxFloat32x3 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxFloat32x4 ffxMax (FfxFloat32x4 x, FfxFloat32x4 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxInt32x2 ffxMax (FfxInt32x2 x, FfxInt32x2 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxInt32x3 ffxMax (FfxInt32x3 x, FfxInt32x3 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxInt32x4 ffxMax (FfxInt32x4 x, FfxInt32x4 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxUInt32x2 ffxMax (FfxUInt32x2 x, FfxUInt32x2 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxUInt32x3 ffxMax (FfxUInt32x3 x, FfxUInt32x3 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxMax
FfxUInt32x4 ffxMax (FfxUInt32x4 x, FfxUInt32x4 y)
Compute the max of two values.
Parameters:
x |
The first value to compute the max of. |
y |
The second value to compute the max of. |
Returns:
The the lowest of two values.
ffxPow
FfxFloat32 ffxPow (FfxFloat32 x, FfxFloat32 y)
Compute the value of the first parameter raised to the power of the second.
Parameters:
x |
The value to raise to the power y. |
y |
The power to which to raise x. |
Returns:
The value of the first parameter raised to the power of the second.
ffxPow
FfxFloat32x2 ffxPow (FfxFloat32x2 x, FfxFloat32x2 y)
Compute the value of the first parameter raised to the power of the second.
Parameters:
x |
The value to raise to the power y. |
y |
The power to which to raise x. |
Returns:
The value of the first parameter raised to the power of the second.
ffxPow
FfxFloat32x3 ffxPow (FfxFloat32x3 x, FfxFloat32x3 y)
Compute the value of the first parameter raised to the power of the second.
Parameters:
x |
The value to raise to the power y. |
y |
The power to which to raise x. |
Returns:
The value of the first parameter raised to the power of the second.
ffxPow
FfxFloat32x4 ffxPow (FfxFloat32x4 x, FfxFloat32x4 y)
Compute the value of the first parameter raised to the power of the second.
Parameters:
x |
The value to raise to the power y. |
y |
The power to which to raise x. |
Returns:
The value of the first parameter raised to the power of the second.
ffxCopySignBit
FfxFloat32 ffxCopySignBit (FfxFloat32 d, FfxFloat32 s)
Copy the sign bit from ‘s’ to positive ‘d’.
Parameters:
d |
The value to copy the sign bit into. |
s |
The value to copy the sign bit from. |
Returns:
The value of d
with the sign bit from s
.
ffxCopySignBit
FfxFloat32x2 ffxCopySignBit (FfxFloat32x2 d, FfxFloat32x2 s)
Copy the sign bit from ‘s’ to positive ‘d’.
Parameters:
d |
The value to copy the sign bit into. |
s |
The value to copy the sign bit from. |
Returns:
The value of d
with the sign bit from s
.
ffxCopySignBit
FfxFloat32x3 ffxCopySignBit (FfxFloat32x3 d, FfxFloat32x3 s)
Copy the sign bit from ‘s’ to positive ‘d’.
Parameters:
d |
The value to copy the sign bit into. |
s |
The value to copy the sign bit from. |
Returns:
The value of d
with the sign bit from s
.
ffxCopySignBit
FfxFloat32x4 ffxCopySignBit (FfxFloat32x4 d, FfxFloat32x4 s)
Copy the sign bit from ‘s’ to positive ‘d’.
Parameters:
d |
The value to copy the sign bit into. |
s |
The value to copy the sign bit from. |
Returns:
The value of d
with the sign bit from s
.
ffxIsSigned
FfxFloat32 ffxIsSigned (FfxFloat32 m)
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against 0. |
Returns:
1.0 when the value is negative, or 0.0 when the value is 0 or position.
ffxIsSigned
FfxFloat32x2 ffxIsSigned (FfxFloat32x2 m)
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against 0. |
Returns:
1.0 when the value is negative, or 0.0 when the value is 0 or position.
ffxIsSigned
FfxFloat32x3 ffxIsSigned (FfxFloat32x3 m)
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against 0. |
Returns:
1.0 when the value is negative, or 0.0 when the value is 0 or position.
ffxIsSigned
FfxFloat32x4 ffxIsSigned (FfxFloat32x4 m)
A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.
Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against for have the sign set. |
Returns:
1.0 when the value is negative, or 0.0 when the value is 0 or positive.
ffxIsGreaterThanZero
FfxFloat32 ffxIsGreaterThanZero (FfxFloat32 m)
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against zero. |
Returns:
1.0 when the value is position, or 0.0 when the value is 0 or negative.
ffxIsGreaterThanZero
FfxFloat32x2 ffxIsGreaterThanZero (FfxFloat32x2 m)
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against zero. |
Returns:
1.0 when the value is position, or 0.0 when the value is 0 or negative.
ffxIsGreaterThanZero
FfxFloat32x3 ffxIsGreaterThanZero (FfxFloat32x3 m)
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against zero. |
Returns:
1.0 when the value is position, or 0.0 when the value is 0 or negative.
ffxIsGreaterThanZero
FfxFloat32x4 ffxIsGreaterThanZero (FfxFloat32x4 m)
A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.
This function is useful when creating masks for branch-free logic.
Parameters:
m |
The value to test against zero. |
Returns:
1.0 when the value is position, or 0.0 when the value is 0 or negative.
ffxFloatToSortableInteger
Convert a 32bit floating point value to sortable integer.
-
If sign bit=0, flip the sign bit (positives).
-
If sign bit=1, flip all bits (negatives).
The function has the side effects that:
-
Larger integers are more positive values.
-
Float zero is mapped to center of integers (so clear to integer zero is a nice default for atomic max usage).
Parameters:
value |
The floating point value to make sortable. |
Returns:
The sortable integer value.
ffxSortableIntegerToFloat
Convert a sortable integer to a 32bit floating point value.
The function has the side effects that:
-
If sign bit=1, flip the sign bit (positives).
-
If sign bit=0, flip all bits (negatives).
Parameters:
value |
The floating point value to make sortable. |
Returns:
The sortable integer value.
ffxApproximateSqrt
FfxFloat32 ffxApproximateSqrt (FfxFloat32 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateReciprocal
FfxFloat32 ffxApproximateReciprocal (FfxFloat32 value)
Calculate a low-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to low quality.
ffxApproximateReciprocalMedium
FfxFloat32 ffxApproximateReciprocalMedium (FfxFloat32 value)
Calculate a medium-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to medium quality.
ffxApproximateReciprocalSquareRoot
FfxFloat32 ffxApproximateReciprocalSquareRoot (FfxFloat32 value)
Calculate a low-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal square root for. |
Returns:
An approximation of the reciprocal square root, estimated to low quality.
ffxApproximateSqrt
FfxFloat32x2 ffxApproximateSqrt (FfxFloat32x2 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateReciprocal
FfxFloat32x2 ffxApproximateReciprocal (FfxFloat32x2 value)
Calculate a low-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to low quality.
ffxApproximateReciprocalMedium
FfxFloat32x2 ffxApproximateReciprocalMedium (FfxFloat32x2 value)
Calculate a medium-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to medium quality.
ffxApproximateReciprocalSquareRoot
FfxFloat32x2 ffxApproximateReciprocalSquareRoot (FfxFloat32x2 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateSqrt
FfxFloat32x3 ffxApproximateSqrt (FfxFloat32x3 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateReciprocal
FfxFloat32x3 ffxApproximateReciprocal (FfxFloat32x3 value)
Calculate a low-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to low quality.
ffxApproximateReciprocalMedium
FfxFloat32x3 ffxApproximateReciprocalMedium (FfxFloat32x3 value)
Calculate a medium-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to medium quality.
ffxApproximateReciprocalSquareRoot
FfxFloat32x3 ffxApproximateReciprocalSquareRoot (FfxFloat32x3 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateSqrt
FfxFloat32x4 ffxApproximateSqrt (FfxFloat32x4 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxApproximateReciprocal
FfxFloat32x4 ffxApproximateReciprocal (FfxFloat32x4 value)
Calculate a low-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to low quality.
ffxApproximateReciprocalMedium
FfxFloat32x4 ffxApproximateReciprocalMedium (FfxFloat32x4 value)
Calculate a medium-quality approximation for the reciprocal of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the reciprocal for. |
Returns:
An approximation of the reciprocal, estimated to medium quality.
ffxApproximateReciprocalSquareRoot
FfxFloat32x4 ffxApproximateReciprocalSquareRoot (FfxFloat32x4 value)
Calculate a low-quality approximation for the square root of a value.
For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:
-
https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
-
https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
Parameters:
value |
The value to calculate an approximate to the square root for. |
Returns:
An approximation of the square root, estimated to low quality.
ffxDot2
FfxFloat32 ffxDot2 (FfxFloat32x2 a, FfxFloat32x2 b)
Calculate dot product of ‘a’ and ‘b’.
Parameters:
a |
First vector input. |
b |
Second vector input. |
Returns:
The value of a
dot b
.
ffxDot3
FfxFloat32 ffxDot3 (FfxFloat32x3 a, FfxFloat32x3 b)
Calculate dot product of ‘a’ and ‘b’.
Parameters:
a |
First vector input. |
b |
Second vector input. |
Returns:
The value of a
dot b
.
ffxDot4
FfxFloat32 ffxDot4 (FfxFloat32x4 a, FfxFloat32x4 b)
Calculate dot product of ‘a’ and ‘b’.
Parameters:
a |
First vector input. |
b |
Second vector input. |
Returns:
The value of a
dot b
.
ffxApproximatePQToGamma2Medium
FfxFloat32 ffxApproximatePQToGamma2Medium (FfxFloat32 a)
Compute an approximate conversion from PQ to Gamma2 space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and Gamma2. |
Returns:
The value a
converted into Gamma2.
ffxApproximatePQToLinear
FfxFloat32 ffxApproximatePQToLinear (FfxFloat32 a)
Compute an approximate conversion from PQ to linear space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and linear. |
Returns:
The value a
converted into linear.
ffxApproximateGamma2ToPQ
FfxFloat32 ffxApproximateGamma2ToPQ (FfxFloat32 a)
Compute an approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQMedium
FfxFloat32 ffxApproximateGamma2ToPQMedium (FfxFloat32 a)
Compute a more accurate approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQHigh
FfxFloat32 ffxApproximateGamma2ToPQHigh (FfxFloat32 a)
Compute a high accuracy approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQ
FfxFloat32 ffxApproximateLinearToPQ (FfxFloat32 a)
Compute an approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQMedium
FfxFloat32 ffxApproximateLinearToPQMedium (FfxFloat32 a)
Compute a more accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQHigh
FfxFloat32 ffxApproximateLinearToPQHigh (FfxFloat32 a)
Compute a very accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximatePQToGamma2Medium
FfxFloat32x2 ffxApproximatePQToGamma2Medium (FfxFloat32x2 a)
Compute an approximate conversion from PQ to Gamma2 space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and Gamma2. |
Returns:
The value a
converted into Gamma2.
ffxApproximatePQToLinear
FfxFloat32x2 ffxApproximatePQToLinear (FfxFloat32x2 a)
Compute an approximate conversion from PQ to linear space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and linear. |
Returns:
The value a
converted into linear.
ffxApproximateGamma2ToPQ
FfxFloat32x2 ffxApproximateGamma2ToPQ (FfxFloat32x2 a)
Compute an approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQMedium
FfxFloat32x2 ffxApproximateGamma2ToPQMedium (FfxFloat32x2 a)
Compute a more accurate approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQHigh
FfxFloat32x2 ffxApproximateGamma2ToPQHigh (FfxFloat32x2 a)
Compute a high accuracy approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQ
FfxFloat32x2 ffxApproximateLinearToPQ (FfxFloat32x2 a)
Compute an approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQMedium
FfxFloat32x2 ffxApproximateLinearToPQMedium (FfxFloat32x2 a)
Compute a more accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQHigh
FfxFloat32x2 ffxApproximateLinearToPQHigh (FfxFloat32x2 a)
Compute a very accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximatePQToGamma2Medium
FfxFloat32x3 ffxApproximatePQToGamma2Medium (FfxFloat32x3 a)
Compute an approximate conversion from PQ to Gamma2 space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and Gamma2. |
Returns:
The value a
converted into Gamma2.
ffxApproximatePQToLinear
FfxFloat32x3 ffxApproximatePQToLinear (FfxFloat32x3 a)
Compute an approximate conversion from PQ to linear space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and linear. |
Returns:
The value a
converted into linear.
ffxApproximateGamma2ToPQ
FfxFloat32x3 ffxApproximateGamma2ToPQ (FfxFloat32x3 a)
Compute an approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQMedium
FfxFloat32x3 ffxApproximateGamma2ToPQMedium (FfxFloat32x3 a)
Compute a more accurate approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQHigh
FfxFloat32x3 ffxApproximateGamma2ToPQHigh (FfxFloat32x3 a)
Compute a high accuracy approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQ
FfxFloat32x3 ffxApproximateLinearToPQ (FfxFloat32x3 a)
Compute an approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQMedium
FfxFloat32x3 ffxApproximateLinearToPQMedium (FfxFloat32x3 a)
Compute a more accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQHigh
FfxFloat32x3 ffxApproximateLinearToPQHigh (FfxFloat32x3 a)
Compute a very accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximatePQToGamma2Medium
FfxFloat32x4 ffxApproximatePQToGamma2Medium (FfxFloat32x4 a)
Compute an approximate conversion from PQ to Gamma2 space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and Gamma2. |
Returns:
The value a
converted into Gamma2.
ffxApproximatePQToLinear
FfxFloat32x4 ffxApproximatePQToLinear (FfxFloat32x4 a)
Compute an approximate conversion from PQ to linear space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between PQ and linear. |
Returns:
The value a
converted into linear.
ffxApproximateGamma2ToPQ
FfxFloat32x4 ffxApproximateGamma2ToPQ (FfxFloat32x4 a)
Compute an approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQMedium
FfxFloat32x4 ffxApproximateGamma2ToPQMedium (FfxFloat32x4 a)
Compute a more accurate approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateGamma2ToPQHigh
FfxFloat32x4 ffxApproximateGamma2ToPQHigh (FfxFloat32x4 a)
Compute a high accuracy approximate conversion from gamma2 to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between gamma2 and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQ
FfxFloat32x4 ffxApproximateLinearToPQ (FfxFloat32x4 a)
Compute an approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQMedium
FfxFloat32x4 ffxApproximateLinearToPQMedium (FfxFloat32x4 a)
Compute a more accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxApproximateLinearToPQHigh
FfxFloat32x4 ffxApproximateLinearToPQHigh (FfxFloat32x4 a)
Compute a very accurate approximate conversion from linear to PQ space.
PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.
Parameters:
a |
The value to convert between linear and PQ. |
Returns:
The value a
converted into PQ.
ffxZeroOneAnd
Conditional free logic AND operation using values.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
Returns:
Result of the AND operation.
ffxZeroOneAnd
FfxUInt32x2 ffxZeroOneAnd (FfxUInt32x2 x, FfxUInt32x2 y)
Conditional free logic AND operation using two values.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
Returns:
Result of the AND operation.
ffxZeroOneAnd
FfxUInt32x3 ffxZeroOneAnd (FfxUInt32x3 x, FfxUInt32x3 y)
Conditional free logic AND operation using two values.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
Returns:
Result of the AND operation.
ffxZeroOneAnd
FfxUInt32x4 ffxZeroOneAnd (FfxUInt32x4 x, FfxUInt32x4 y)
Conditional free logic AND operation using two values.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
Returns:
Result of the AND operation.
ffxZeroOneAnd
Conditional free logic NOT operation using two values.
Parameters:
x |
The first value to be fed into the NOT operator. |
Returns:
Result of the NOT operation.
ffxZeroOneAnd
FfxUInt32x2 ffxZeroOneAnd (FfxUInt32x2 x)
Conditional free logic NOT operation using two values.
Parameters:
x |
The first value to be fed into the NOT operator. |
Returns:
Result of the NOT operation.
ffxZeroOneAnd
FfxUInt32x3 ffxZeroOneAnd (FfxUInt32x3 x)
Conditional free logic NOT operation using two values.
Parameters:
x |
The first value to be fed into the NOT operator. |
Returns:
Result of the NOT operation.
ffxZeroOneAnd
FfxUInt32x4 ffxZeroOneAnd (FfxUInt32x4 x)
Conditional free logic NOT operation using two values.
Parameters:
x |
The first value to be fed into the NOT operator. |
Returns:
Result of the NOT operation.
ffxZeroOneOr
Conditional free logic OR operation using two values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxUInt32x2 ffxZeroOneOr (FfxUInt32x2 x, FfxUInt32x2 y)
Conditional free logic OR operation using two values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxUInt32x3 ffxZeroOneOr (FfxUInt32x3 x, FfxUInt32x3 y)
Conditional free logic OR operation using two values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxUInt32x4 ffxZeroOneOr (FfxUInt32x4 x, FfxUInt32x4 y)
Conditional free logic OR operation using two values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneAndToU1
FfxUInt32 ffxZeroOneAndToU1 (FfxFloat32 x)
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndToU2
FfxUInt32x2 ffxZeroOneAndToU2 (FfxFloat32x2 x)
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndToU3
FfxUInt32x3 ffxZeroOneAndToU3 (FfxFloat32x3 x)
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndToU4
FfxUInt32x4 ffxZeroOneAndToU4 (FfxFloat32x4 x)
Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndOr
FfxFloat32 ffxZeroOneAndOr (FfxFloat32 x, FfxFloat32 y, FfxFloat32 z)
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
z |
The second value to be fed into the OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndOr
FfxFloat32x2 ffxZeroOneAndOr (
FfxFloat32x2 x,
FfxFloat32x2 y,
FfxFloat32x2 z
)
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
z |
The second value to be fed into the OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndOr
FfxFloat32x3 ffxZeroOneAndOr (
FfxFloat32x3 x,
FfxFloat32x3 y,
FfxFloat32x3 z
)
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
z |
The second value to be fed into the OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAndOr
FfxFloat32x4 ffxZeroOneAndOr (
FfxFloat32x4 x,
FfxFloat32x4 y,
FfxFloat32x4 z
)
Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.
Parameters:
x |
The first value to be fed into the AND operator. |
y |
The second value to be fed into the AND operator. |
z |
The second value to be fed into the OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneIsGreaterThanZero
FfxFloat32 ffxZeroOneIsGreaterThanZero (FfxFloat32 x)
Given a value, returns 1.0 if greater than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the greater than zero comparison.
ffxZeroOneIsGreaterThanZero
FfxFloat32x2 ffxZeroOneIsGreaterThanZero (FfxFloat32x2 x)
Given a value, returns 1.0 if greater than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the greater than zero comparison.
ffxZeroOneIsGreaterThanZero
FfxFloat32x3 ffxZeroOneIsGreaterThanZero (FfxFloat32x3 x)
Given a value, returns 1.0 if greater than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the greater than zero comparison.
ffxZeroOneIsGreaterThanZero
FfxFloat32x4 ffxZeroOneIsGreaterThanZero (FfxFloat32x4 x)
Given a value, returns 1.0 if greater than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the greater than zero comparison.
ffxZeroOneAnd
FfxFloat32 ffxZeroOneAnd (FfxFloat32 x)
Conditional free logic signed NOT operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAnd
FfxFloat32x2 ffxZeroOneAnd (FfxFloat32x2 x)
Conditional free logic signed NOT operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAnd
FfxFloat32x3 ffxZeroOneAnd (FfxFloat32x3 x)
Conditional free logic signed NOT operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneAnd
FfxFloat32x4 ffxZeroOneAnd (FfxFloat32x4 x)
Conditional free logic signed NOT operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the AND OR operator. |
Returns:
Result of the AND OR operation.
ffxZeroOneOr
FfxFloat32 ffxZeroOneOr (FfxFloat32 x, FfxFloat32 y)
Conditional free logic OR operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxFloat32x2 ffxZeroOneOr (FfxFloat32x2 x, FfxFloat32x2 y)
Conditional free logic OR operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxFloat32x3 ffxZeroOneOr (FfxFloat32x3 x, FfxFloat32x3 y)
Conditional free logic OR operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneOr
FfxFloat32x4 ffxZeroOneOr (FfxFloat32x4 x, FfxFloat32x4 y)
Conditional free logic OR operation using two FfxFloat32 values.
Parameters:
x |
The first value to be fed into the OR operator. |
y |
The second value to be fed into the OR operator. |
Returns:
Result of the OR operation.
ffxZeroOneSelect
FfxFloat32 ffxZeroOneSelect (FfxFloat32 x, FfxFloat32 y, FfxFloat32 z)
Choose between two FfxFloat32 values if the first paramter is greater than zero.
Parameters:
x |
The value to compare against zero. |
y |
The value to return if the comparision is greater than zero. |
z |
The value to return if the comparision is less than or equal to zero. |
Returns:
The selected value.
ffxZeroOneSelect
FfxFloat32x2 ffxZeroOneSelect (
FfxFloat32x2 x,
FfxFloat32x2 y,
FfxFloat32x2 z
)
Choose between two FfxFloat32 values if the first paramter is greater than zero.
Parameters:
x |
The value to compare against zero. |
y |
The value to return if the comparision is greater than zero. |
z |
The value to return if the comparision is less than or equal to zero. |
Returns:
The selected value.
ffxZeroOneSelect
FfxFloat32x3 ffxZeroOneSelect (
FfxFloat32x3 x,
FfxFloat32x3 y,
FfxFloat32x3 z
)
Choose between two FfxFloat32 values if the first paramter is greater than zero.
Parameters:
x |
The value to compare against zero. |
y |
The value to return if the comparision is greater than zero. |
z |
The value to return if the comparision is less than or equal to zero. |
Returns:
The selected value.
ffxZeroOneSelect
FfxFloat32x4 ffxZeroOneSelect (
FfxFloat32x4 x,
FfxFloat32x4 y,
FfxFloat32x4 z
)
Choose between two FfxFloat32 values if the first paramter is greater than zero.
Parameters:
x |
The value to compare against zero. |
y |
The value to return if the comparision is greater than zero. |
z |
The value to return if the comparision is less than or equal to zero. |
Returns:
The selected value.
ffxZeroOneIsSigned
FfxFloat32 ffxZeroOneIsSigned (FfxFloat32 x)
Given a value, returns 1.0 if less than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the sign value.
ffxZeroOneIsSigned
FfxFloat32x2 ffxZeroOneIsSigned (FfxFloat32x2 x)
Given a value, returns 1.0 if less than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the sign value.
ffxZeroOneIsSigned
FfxFloat32x3 ffxZeroOneIsSigned (FfxFloat32x3 x)
Given a value, returns 1.0 if less than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the sign value.
ffxZeroOneIsSigned
FfxFloat32x4 ffxZeroOneIsSigned (FfxFloat32x4 x)
Given a value, returns 1.0 if less than zero and 0.0 if not.
Parameters:
x |
The value to be compared. |
Returns:
Result of the sign value.
ffxRec709FromLinear
FfxFloat32 ffxRec709FromLinear (FfxFloat32 color)
Compute a Rec.709 color space.
Rec.709 is used for some HDTVs.
Both Rec.709 and sRGB have a linear segment which as spec’ed would intersect the curved segment 2 times. (a.) For 8-bit sRGB, steps {0 to 10.3} are in the linear region (4% of the encoding range). (b.) For 8-bit 709, steps {0 to 20.7} are in the linear region (8% of the encoding range).
Parameters:
color |
The color to convert to Rec. 709. |
Returns:
The color
in linear space.
ffxRec709FromLinear
FfxFloat32x2 ffxRec709FromLinear (FfxFloat32x2 color)
Compute a Rec.709 color space.
Rec.709 is used for some HDTVs.
Both Rec.709 and sRGB have a linear segment which as spec’ed would intersect the curved segment 2 times. (a.) For 8-bit sRGB, steps {0 to 10.3} are in the linear region (4% of the encoding range). (b.) For 8-bit 709, steps {0 to 20.7} are in the linear region (8% of the encoding range).
Parameters:
color |
The color to convert to Rec. 709. |
Returns:
The color
in linear space.
ffxRec709FromLinear
FfxFloat32x3 ffxRec709FromLinear (FfxFloat32x3 color)
Compute a Rec.709 color space.
Rec.709 is used for some HDTVs.
Both Rec.709 and sRGB have a linear segment which as spec’ed would intersect the curved segment 2 times. (a.) For 8-bit sRGB, steps {0 to 10.3} are in the linear region (4% of the encoding range). (b.) For 8-bit 709, steps {0 to 20.7} are in the linear region (8% of the encoding range).
Parameters:
color |
The color to convert to Rec. 709. |
Returns:
The color
in linear space.
ffxLinearFromRec709
FfxFloat32 ffxLinearFromRec709 (FfxFloat32 color)
Compute a linear value from a REC.709 value.
Parameters:
color |
The value to convert to linear from REC.709. |
Returns:
A value in linear space.
ffxLinearFromRec709
FfxFloat32x2 ffxLinearFromRec709 (FfxFloat32x2 color)
Compute a linear value from a REC.709 value.
Parameters:
color |
The value to convert to linear from REC.709. |
Returns:
A value in linear space.
ffxLinearFromRec709
FfxFloat32x3 ffxLinearFromRec709 (FfxFloat32x3 color)
Compute a linear value from a REC.709 value.
Parameters:
color |
The value to convert to linear from REC.709. |
Returns:
A value in linear space.
ffxGammaFromLinear
FfxFloat32 ffxGammaFromLinear (FfxFloat32 value, FfxFloat32 power)
Compute a gamma value from a linear value.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Note: ‘rcpX’ is ‘1/x’, where the ‘x’ is what would be used in ffxLinearFromGamma
.
Parameters:
value |
The value to convert to gamma space from linear. |
power |
The reciprocal of power value used for the gamma curve. |
Returns:
A value in gamma space.
ffxGammaFromLinear
FfxFloat32x2 ffxGammaFromLinear (FfxFloat32x2 value, FfxFloat32 power)
Compute a gamma value from a linear value.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Note: ‘rcpX’ is ‘1/x’, where the ‘x’ is what would be used in ffxLinearFromGamma
.
Parameters:
value |
The value to convert to gamma space from linear. |
power |
The reciprocal of power value used for the gamma curve. |
Returns:
A value in gamma space.
ffxGammaFromLinear
FfxFloat32x3 ffxGammaFromLinear (FfxFloat32x3 value, FfxFloat32 power)
Compute a gamma value from a linear value.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Note: ‘rcpX’ is ‘1/x’, where the ‘x’ is what would be used in ffxLinearFromGamma
.
Parameters:
value |
The value to convert to gamma space from linear. |
power |
The reciprocal of power value used for the gamma curve. |
Returns:
A value in gamma space.
ffxLinearFromGamma
FfxFloat32 ffxLinearFromGamma (FfxFloat32 color, FfxFloat32 power)
Compute a linear value from a value in a gamma space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
color |
The value to convert to linear in gamma space. |
power |
The power value used for the gamma curve. |
Returns:
A value in linear space.
ffxLinearFromGamma
FfxFloat32x2 ffxLinearFromGamma (FfxFloat32x2 color, FfxFloat32 power)
Compute a linear value from a value in a gamma space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
color |
The value to convert to linear in gamma space. |
power |
The power value used for the gamma curve. |
Returns:
A value in linear space.
ffxLinearFromGamma
FfxFloat32x3 ffxLinearFromGamma (FfxFloat32x3 color, FfxFloat32 power)
Compute a linear value from a value in a gamma space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
color |
The value to convert to linear in gamma space. |
power |
The power value used for the gamma curve. |
Returns:
A value in linear space.
ffxPQFromLinear
FfxFloat32 ffxPQFromLinear (FfxFloat32 value)
Compute a PQ value from a linear value.
Parameters:
value |
The value to convert to PQ from linear. |
Returns:
A value in linear space.
ffxPQFromLinear
FfxFloat32x2 ffxPQFromLinear (FfxFloat32x2 value)
Compute a PQ value from a linear value.
Parameters:
value |
The value to convert to PQ from linear. |
Returns:
A value in linear space.
ffxPQFromLinear
FfxFloat32x3 ffxPQFromLinear (FfxFloat32x3 value)
Compute a PQ value from a linear value.
Parameters:
value |
The value to convert to PQ from linear. |
Returns:
A value in linear space.
ffxLinearFromPQ
FfxFloat32 ffxLinearFromPQ (FfxFloat32 value)
Compute a linear value from a value in a PQ space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in PQ space. |
Returns:
A value in linear space.
ffxLinearFromPQ
FfxFloat32x2 ffxLinearFromPQ (FfxFloat32x2 value)
Compute a linear value from a value in a PQ space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in PQ space. |
Returns:
A value in linear space.
ffxLinearFromPQ
FfxFloat32x3 ffxLinearFromPQ (FfxFloat32x3 value)
Compute a linear value from a value in a PQ space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in PQ space. |
Returns:
A value in linear space.
ffxSrgbFromLinear
FfxFloat32 ffxSrgbFromLinear (FfxFloat32 value)
Compute an SRGB value from a linear value.
Parameters:
value |
The value to convert to SRGB from linear. |
Returns:
A value in SRGB space.
ffxSrgbFromLinear
FfxFloat32x2 ffxSrgbFromLinear (FfxFloat32x2 value)
Compute an SRGB value from a linear value.
Parameters:
value |
The value to convert to SRGB from linear. |
Returns:
A value in SRGB space.
ffxSrgbFromLinear
FfxFloat32x3 ffxSrgbFromLinear (FfxFloat32x3 value)
Compute an SRGB value from a linear value.
Parameters:
value |
The value to convert to SRGB from linear. |
Returns:
A value in SRGB space.
ffxLinearFromSrgb
FfxFloat32 ffxLinearFromSrgb (FfxFloat32 value)
Compute a linear value from a value in a SRGB space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in SRGB space. |
Returns:
A value in linear space.
ffxLinearFromSrgb
FfxFloat32x2 ffxLinearFromSrgb (FfxFloat32x2 value)
Compute a linear value from a value in a SRGB space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in SRGB space. |
Returns:
A value in linear space.
ffxLinearFromSrgb
FfxFloat32x3 ffxLinearFromSrgb (FfxFloat32x3 value)
Compute a linear value from a value in a SRGB space.
Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native.
Parameters:
value |
The value to convert to linear in SRGB space. |
Returns:
A value in linear space.
ffxRemapForQuad
FfxUInt32x2 ffxRemapForQuad (FfxUInt32 a)
A remapping of 64×1 to 8×8 imposing rotated 2×2 pixel quads in quad linear.
Remap illustration:
Parameters:
a |
The input 1D coordinates to remap. |
Returns:
The remapped 2D coordinates.
ffxRemapForWaveReduction
FfxUInt32x2 ffxRemapForWaveReduction (FfxUInt32 a)
A helper function performing a remap 64×1 to 8×8 remapping which is necessary for 2D wave reductions.
The 64-wide lane indices to 8×8 remapping is performed as follows:
Parameters:
a |
The input 1D coordinate to remap. |
Returns:
The remapped 2D coordinates.
Macros
FFX_FALSE
A define for a false value in a boolean expression.
FFX_NEGATIVE_INFINITY_FLOAT
A define value for negative infinity.
FFX_PI
A define value for PI.
FFX_POSITIVE_INFINITY_FLOAT
A define value for positive infinity.
FFX_TRUE
A define for a true value in a boolean expression.