Class VaryingHandler

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

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

  • 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)