generalizedPolyhedronSdf

generalizedPolyhedronSdf

Keywords:
  • dodecahedron
  • icosahedron
  • octahedron
  • polyhedron
sdf
generalizedPolyhedronSdf
RayTK
v0.40

Generates one of several different types of polyhedra.

Based on “Generalized Distance Functions” by Akleman and Chen.

Parameters

Name Description Regular Handling Read-Only Handling
Shape

Chooses between several different predefined types of polyhedra, or Custom, which uses the Begin and End parameters to generate different shapes.

Semi-Baked Semi-Baked
  • Custom:
  • Octahedron:
  • Dodecahedron:
  • Icosahedron:
  • Truncated Octahedron:
  • Truncated Icosahedron:
Begin

Only used when the Custom shape. It’s a bit hard to describe, so it’s best to just experiment with it and see how it behaves.

Runtime Baked
End

Used along with Begin.

Runtime Baked
Translate

Shifts the center of the shape.

Runtime Baked
Radius

The size of the shape.

Runtime Baked
Use Exponent

Enables the use of the Exponent, which controls the sharpness of the edges. When this is switched off, the shape will have sharp edges.

Semi-Baked Semi-Baked
Exponent

Controls the sharpness or smoothness of the edges.

Runtime Baked

Inputs

  • Radius Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float
  • Begin End Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: vec4
    • Supports Variables From Inputs: radiusField
  • Exponent Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float
    • Supports Variables From Inputs: radiusField beginEndField