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

    • OUTPUT_TYPE_ZERO

      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

      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

      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

      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

      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

      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

      public final byte mPrimaryOutput
    • mSecondaryOutput

      public final byte mSecondaryOutput
    • mEquation

      public final byte mEquation
    • mSrcFactor

      public final byte mSrcFactor
    • mDstFactor

      public final byte mDstFactor
  • Constructor Details

    • BlendFormula

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

    • hasSecondaryOutput

      public boolean hasSecondaryOutput()
    • modifiesDst

      public boolean modifiesDst()
    • getBlendFormula

      @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.