Skip to content

Latest commit

 

History

History
331 lines (264 loc) · 8.8 KB

File metadata and controls

331 lines (264 loc) · 8.8 KB

Math Utils

Coarse Normal Reconstruction

DescriptionNode Showcase:
Creates a faceted face normal from any derivable input. (typically the depth buffer.)

Input Type Description
Input Float3 The functional input to compute the face direction for.
Output Type Description
Output Float3 A crude face normal of the Input.

Direction To Signed Cube

DescriptionNode Showcase:
Calculates the hit position on a -S to +S 3D cube.

Input Type Description
Direction Float3 The direction vector (doesn't need to be normalized.)
Scale Float3 The scale of the cube.
Output Type Description
Direction On Cube Float3 The reprojected direction, hitting the surface of the cube.
Tangents Float3 The individual side lengths.
Distance Float The distance from the current direction vector to the surface of the cube.

Filtered Cosine

DescriptionNode Showcase:
Implements the analytical model of the cosine function for band limiting.

Input Type Description
Input Float The cosine input.
Output Type Description
Output Float The filtered cosine value.

Get Tangent Delta

DescriptionNode Showcase:
Calculates the scaling factor for a given projection angle.

Input Type Description
Angle (Degrees) Float The projection angle in degrees.
Output Type Description
FOV Slope Float The tangent derivative of the projection angle.

Get UV Analytic Model

DescriptionNode Showcase:
Calculates the primitive values for a filtered procedural function.

Input Type Description
UV Float2 The texture coordinate.
Output Type Description
Domain Size Float2 The UV space the pixel on your screen takes up.
Sample A The left hand side sample point.
Sample B The right hand side sample point.

This follows the integral convention of $$ \int{f(x)dx} = \lim_{w \rightarrow 0}{\frac{F(x+w) - F(x-w)}{w}} $$ Where $x-w$ is Sample A, $x+w$ is Sample B, and $w$ is the Domain Size.

Integral Circle Approximation

Note

Basically, don't worry about this node.

DescriptionNode Showcase:
Used in Analytical Dot Matrix node, representing a circles filtered procedural function.

Input Type Description
UV Float2 The texture coordinate.
Domain Width Float2 The UV space the pixel on your screen takes up.
Output Type Description
F(x, y) Float2 The evaluated integral parts.

Is Inside 01 Range

DescriptionNode Showcase:
Validates the bounds of a UV coordinate are within 0 to 1 range.

Input Type Description
Input Float4 Any dimension of inputs.
Output Type Description
Inside [0 | 1] Float Returns 1 if all components are inside range, otherwise returns 0.

Smooth Max

DescriptionNode Showcase:
Implements a smoother maximum function.

Input Type Description
A Float The first input.
B Float The second input.
Smooth Term Float the square smoothness value.
Output Type Description
Output Float smoothmax(A, B)

Smooth Min

DescriptionNode Showcase:
Implements a smoother minimum function.

Input Type Description
A Float The first input.
B Float The second input.
Smooth Term Float the square smoothness value.
Output Type Description
Output Float smoothmin(A, B)

Smoothstep 10

DescriptionNode Showcase:
Implements a better form of smoothstep(x, 1, 0)

Input Type Description
Input Float The input value.
Output Type Description
Output Float Roughly smoothstep(x, 1, 0)

This function follows as such:

$$ \left( x^2-1 \right)^2 $$

Stairstep (Terracing)

DescriptionNode Showcase:
Splits the UV coordinate space into steps.

Input Type Description
Input Float2 The texture coordinate.
Steps Float The amount of steps to truncate precision by.
Output Type Description
Terraced Output Float2 The stairstepped input.
Continuous Domain Float2 The scaled UV without stairstepping for mipmap level selection.

Step AA

DescriptionNode Showcase:
Implements the step function with anti aliasing.

Input Type Description
Lesser (A) Float4 The less-than component input.
Greater (B) Float4 The greater-than component input.
Output Type Description
B >= A? Float4 The step evaluation with anti-aliasing.

UV ddxy

DescriptionNode Showcase:
All the ddx ddy values you could possibly want.

Input Type Description
UV Float2 The texture coordinate.
Output Type Description
dx dy Float2 ddx(u), ddy(v)
dx dy (abs) Float2 abs(ddx(u)), abs(ddy(v))
max( dx dy ) Float max( abs(ddx(u)), abs(ddy(v)) )
ddxy Float4 xy: ddx(uv), zw: ddy(uv)
ddxy (abs) Float4 xy: abs(ddx(uv)), zw: abs(ddy(uv))
max( ddx ddy ) Float2 max( abs(ddx(uv)), abs(ddy(uv)) )