reshapeValues
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
Name | Description | Regular Handling | Read-Only Handling |
---|---|---|---|
Enable |
Inputs
-
Source
: (required) The field or SDF whose results will be reshaped.- Coordinate Types:
float
vec2
vec3
vec4
- Context Types:
Context
MaterialContext
CameraContext
LightContext
RayContext
ParticleContext
VertexContext
PixelContext
- Return Types:
float
vec4
Sdf
Volume
Ray
Light
Particle
- Coordinate Types:
-
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
VertexContext
PixelContext
- Return Types:
float
vec4
Sdf
Volume
Ray
Light
Particle
- Coordinate Types: