webgl-dsl
    Preparing search index...

    Class Glsl<T>

    Type Parameters

    Index

    Constructors

    Properties

    getValue: (builder: GlslBuilder) => Value<T>
    PI: Scalar = ...

    Methods

    • Conditional expression

      Type Parameters

      Parameters

      • this: Boolean
      • precision: Precision

        Precision of the expression result

      • whenTrue: T

        True brunch of the condition

      • whenFalse: T

        False brunch of the condition

      Returns T

    • Save some expression into a variable.

      The operand is both emitted and traversed only once: the walk runs inside the builder's once() cache, which stores the resulting value, so every later reference returns the cached variable without re-walking the subtree. Memoizing inside mem is therefore safe for deep, heavily shared expression trees — without this, a node referenced N times is walked N times and a deep tree assembles in time exponential in its depth.

      Type Parameters

      Parameters

      Returns T

    • Save some expression with high quality into a variable

      Returns Glsl<T>

    • Save some expression with low quality into a variable

      Returns Glsl<T>

    • Save some expression with medium quality into a variable

      Returns Glsl<T>