triangleSdf2d

triangleSdf2d

sdf2d
triangleSdf2d
RayTK
v0.42

SDF for a 2D triangle.

Parameters

Name Description Regular Handling Read-Only Handling
Shape

Which type of triangle to produce. The types are defined by different sets of parameters.

Semi-Baked Semi-Baked
  • Equilateral Triangle: An equilateral triangle (all sides are the same). This is defined based on `Radius`. The triangle is centered around the origin.
  • Isosceles Triangle: An iscosceles triangle (2 sides are the same). This is defined based on `Width` and `Height`. The tip of the triangle is placed at the origin.
  • Inverted Isosceles Triangle:
  • Abritrary Triangle: An arbitrary triangle based on 3 points.
Radius

The distance from the center to each corner of the triangle. Used for equilateral triangles.

Runtime Semi-Baked
Height

The distance from the base of an iscosceles triangle to the opposite tip.

Runtime Semi-Baked
Width

The width of the base of an isosceles triangle.

Runtime Semi-Baked
Point 1

The first corner position, for an arbitrary triangle.

Runtime Baked
Point 2

The second corner position, for an arbitrary triangle.

Runtime Baked
Point 3

The third corner position, for an arbitrary triangle.

Runtime Baked
Direction Runtime Baked
  • Right (X+):
  • Left (X-):
  • Up (Y+):
  • Down (Y-):

Inputs

  • Radius Field: (optional)
    • Coordinate Types: vec2
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float
  • Height/Width Field: (optional)
    • Coordinate Types: vec2
    • Context Types: Context MaterialContext CameraContext LightContext RayContext ParticleContext VertexContext PixelContext
    • Return Types: float
    • Supports Variables From Inputs: radiusField