Skip to main content Link Menu Expand (external link) Document Search Copy Copied

reshapeValues

beta

Reshapes the values produced by a field by applying a function.

If the source field produces float values, the function is just applied to those values, returning whatever type the function returns. If the source field produces vector values, the function is applied individually to each channel in the produced values. If the source is an SDF, the function is applied to the distance value in the SDF result.

Parameters

  • Enable:

Inputs

  • Source: (required) The field or SDF whose results will be reshaped.
    • Coordinate Types: float vec2 vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float vec4 Sdf Ray Light Particle
  • Function: (optional) The function that is applied to the results of the source field. In cases where the source field produces vectors but the function only works of single values, the function will be called 4 times. That can end up costly if the function is complex, though most function ops are relatively cheap.
    • Coordinate Types: float
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float vec4 Sdf Ray Light Particle