Package icyllis.arc3d.granite.shading

# Class VaryingHandler

java.lang.Object
icyllis.arc3d.granite.shading.VaryingHandler

public class VaryingHandler extends Object
Builds shader stage inputs and outputs.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `VaryingHandler.VaryingInfo`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `kCanBeFlat_Interpolation`
  `static final int`
  `kRequiredToBeFlat_Interpolation`
  `static final int`
  `kSmooth_Interpolation`
  `protected final ArrayList<ShaderVar>`
  `mFragInputs`
  `protected final ShaderCaps`
  `mShaderCaps`
  `protected final ArrayList<VaryingHandler.VaryingInfo>`
  `mVaryings`
  `protected final ArrayList<ShaderVar>`
  `mVertexOutputs`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VaryingHandler(ShaderCaps shaderCaps)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `addVarying(String name, byte type)`
  Convenience for `addVarying(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`
  `setNoPerspective()`
  Notifies the varying handler that this shader will never emit geometry in perspective and therefore does not require perspective-correct interpolation.

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

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

- ## Field Details

  - ### kSmooth_Interpolation

    public static final int kSmooth_Interpolation
    See Also:
      - Constant Field Values

  - ### kCanBeFlat_Interpolation

    public static final int kCanBeFlat_Interpolation
    See Also:
      - Constant Field Values

  - ### kRequiredToBeFlat_Interpolation

    public static final int kRequiredToBeFlat_Interpolation
    See Also:
      - Constant Field Values

  - ### mVaryings

    protected final ArrayList<VaryingHandler.VaryingInfo> mVaryings

  - ### mVertexOutputs

    protected final ArrayList<ShaderVar> mVertexOutputs

  - ### mFragInputs

    protected final ArrayList<ShaderVar> mFragInputs

  - ### mShaderCaps

    protected final ShaderCaps mShaderCaps

- ## Constructor Details

  - ### VaryingHandler

    public VaryingHandler(ShaderCaps shaderCaps)

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

    public final void addVarying(String name, byte type)
    Convenience for `addVarying(String, byte, int)` that uses smooth or noperspective interpolation.

  - ### addVarying

    public final void addVarying(String name, byte type, int interpolation)
    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

    public final void getVertDecls(StringBuilder outputDecls)

  - ### getFragDecls

    public final void getFragDecls(StringBuilder inputDecls)