Class BlendFormula

java.lang.Object
icyllis.arc3d.granite.BlendFormula

public final class BlendFormula extends Object
Wraps the shader outputs and HW blend state that comprise a Porter Duff blend mode with coverage.
  • Field Details Link icon

    • OUTPUT_TYPE_ZERO Link icon

      public static final byte OUTPUT_TYPE_ZERO
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • OUTPUT_TYPE_COVERAGE Link icon

      public static final byte OUTPUT_TYPE_COVERAGE
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • OUTPUT_TYPE_MODULATE Link icon

      public static final byte OUTPUT_TYPE_MODULATE
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • OUTPUT_TYPE_SRC_ALPHA_MODULATE Link icon

      public static final byte OUTPUT_TYPE_SRC_ALPHA_MODULATE
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • OUTPUT_TYPE_ONE_MINUS_SRC_ALPHA_MODULATE Link icon

      public static final byte OUTPUT_TYPE_ONE_MINUS_SRC_ALPHA_MODULATE
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • OUTPUT_TYPE_ONE_MINUS_SRC_COLOR_MODULATE Link icon

      public static final byte OUTPUT_TYPE_ONE_MINUS_SRC_COLOR_MODULATE
      Values the shader can write to primary and secondary outputs. These are all modulated by coverage. We will ignore the multiplies when not using coverage.
      See Also:
    • mPrimaryOutput Link icon

      public final byte mPrimaryOutput
    • mSecondaryOutput Link icon

      public final byte mSecondaryOutput
    • mEquation Link icon

      public final byte mEquation
    • mSrcFactor Link icon

      public final byte mSrcFactor
    • mDstFactor Link icon

      public final byte mDstFactor
  • Constructor Details Link icon

    • BlendFormula Link icon

      public BlendFormula(byte primaryOutput, byte secondaryOutput, byte equation, byte srcFactor, byte dstFactor)
  • Method Details Link icon

    • hasSecondaryOutput Link icon

      public boolean hasSecondaryOutput()
    • modifiesDst Link icon

      public boolean modifiesDst()
    • getBlendFormula Link icon

      @Nullable public static BlendFormula getBlendFormula(boolean isOpaque, boolean hasCoverage, @Nonnull BlendMode mode)
      This table outlines the blend formulas we will use with each blend mode, with and without coverage, with and without an opaque input color.