generalizedPolyhedronSdf

generalizedPolyhedronSdf

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

Generates one of several different types of polyhedra.

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

Parameters

  • Shape: Chooses between several different predefined types of polyhedra, or `Custom`, which uses the `Begin` and `End` parameters to generate different shapes.
    • 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.
  • End: Used along with `Begin`.
  • Translate: Shifts the center of the shape.
  • Radius: The size of the shape.
  • 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.
  • Exponent: Controls the sharpness or smoothness of the edges.

Inputs

  • Radius Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float
  • Begin End Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: vec4
  • Exponent Field: (optional)
    • Coordinate Types: vec3
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext
    • Return Types: float