Package icyllis.arc3d.granite
Class BlendFormula
java.lang.Object
icyllis.arc3d.granite.BlendFormula
Wraps the shader outputs and HW blend state that comprise a Porter Duff blend mode with coverage.
-
Field Summary
Modifier and TypeFieldDescriptionfinal byte
final byte
final byte
final byte
final byte
static final byte
Values the shader can write to primary and secondary outputs.static final byte
Values the shader can write to primary and secondary outputs.static final byte
Values the shader can write to primary and secondary outputs.static final byte
Values the shader can write to primary and secondary outputs.static final byte
Values the shader can write to primary and secondary outputs.static final byte
Values the shader can write to primary and secondary outputs. -
Constructor Summary
ConstructorDescriptionBlendFormula
(byte primaryOutput, byte secondaryOutput, byte equation, byte srcFactor, byte dstFactor) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
boolean
-
Field Details
-
OUTPUT_TYPE_ZERO
public static final byte OUTPUT_TYPE_ZEROValues 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_COVERAGEValues 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_MODULATEValues 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_MODULATEValues 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_MODULATEValues 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_MODULATEValues 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.
-