Package icyllis.arc3d.granite

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `final byte`
  `mDstFactor`
  `final byte`
  `mEquation`
  `final byte`
  `mPrimaryOutput`
  `final byte`
  `mSecondaryOutput`
  `final byte`
  `mSrcFactor`
  `static final byte`
  `OUTPUT_TYPE_COVERAGE`
  Values the shader can write to primary and secondary outputs.
  `static final byte`
  `OUTPUT_TYPE_MODULATE`
  Values the shader can write to primary and secondary outputs.
  `static final byte`
  `OUTPUT_TYPE_ONE_MINUS_SRC_ALPHA_MODULATE`
  Values the shader can write to primary and secondary outputs.
  `static final byte`
  `OUTPUT_TYPE_ONE_MINUS_SRC_COLOR_MODULATE`
  Values the shader can write to primary and secondary outputs.
  `static final byte`
  `OUTPUT_TYPE_SRC_ALPHA_MODULATE`
  Values the shader can write to primary and secondary outputs.
  `static final byte`
  `OUTPUT_TYPE_ZERO`
  Values the shader can write to primary and secondary outputs.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlendFormula(byte primaryOutput, byte secondaryOutput, byte equation, byte srcFactor, byte dstFactor)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BlendFormula`
  `getBlendFormula(boolean isOpaque, boolean hasCoverage, 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.
  `boolean`
  `hasSecondaryOutput()`
  `boolean`
  `modifiesDst()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

  - ### 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:
      - Constant Field Values

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