Package icyllis.arc3d.granite.shading
Class VaryingHandler
java.lang.Object
icyllis.arc3d.granite.shading.VaryingHandler
Builds shader stage inputs and outputs.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
protected final ShaderCaps
protected final ArrayList
<VaryingHandler.VaryingInfo> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addVarying
(String name, byte type) Convenience foraddVarying(String, byte, int)
that uses smooth or noperspective interpolation.final void
addVarying
(String name, byte type, int interpolation) addVarying allows fine-grained control for setting up varyings between stages.final void
finish()
final void
getFragDecls
(StringBuilder inputDecls) final void
getVertDecls
(StringBuilder outputDecls) protected void
onFinish()
final void
Notifies the varying handler that this shader will never emit geometry in perspective and therefore does not require perspective-correct interpolation.
-
Field Details
-
kSmooth_Interpolation
public static final int kSmooth_Interpolation- See Also:
-
kCanBeFlat_Interpolation
public static final int kCanBeFlat_Interpolation- See Also:
-
kRequiredToBeFlat_Interpolation
public static final int kRequiredToBeFlat_Interpolation- See Also:
-
mVaryings
-
mVertexOutputs
-
mFragInputs
-
mShaderCaps
-
-
Constructor Details
-
VaryingHandler
-
-
Method Details
-
setNoPerspective
public final void setNoPerspective()Notifies the varying handler that this shader will never emit geometry in perspective and therefore does not require perspective-correct interpolation. When supported, this allows varyings to use the "noperspective" keyword, which means the GPU can use cheaper math for interpolation. -
addVarying
Convenience foraddVarying(String, byte, int)
that uses smooth or noperspective interpolation. -
addVarying
addVarying allows fine-grained control for setting up varyings between stages. Calling this function will make sure all necessary decls are setup for the client. The client however is responsible for setting up all shader code (e.g "vOut = vIn;") If you just need to take an attribute and pass it through to an output value in a fragment shader, use addPassThroughAttribute. -
finish
public final void finish() -
onFinish
protected void onFinish() -
getVertDecls
-
getFragDecls
-