almostIdentityFn

almostIdentityFn

function
almostIdentityFn
RayTK
v0.41

A mapping function that can change a value only when it’s zero or very close to it, where it replaces the value with a small constant.

Then, rather than doing a conditional branch which introduces a discontinuity, you can smoothly blend your value with your Threshold.

This is based on Inigo Quilez’s article.

Parameters

Name Description Regular Handling Read-Only Handling
Contexttype
Threshold

The value above which things will be unchanged.

Runtime Baked
Base Value

The constant value to use when the input is zero.

Runtime Baked

Inputs

  • Threshold Field: (optional)
    • Coordinate Types: float
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float
  • Base Value Field: (optional)
    • Coordinate Types: float
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float