com.io7m.r2.core.shaders.types

## Class R2ShaderTranslucentInstanceSingleVerifier<M>

- java.lang.Object
- - com.io7m.r2.core.shaders.types.R2ShaderTranslucentInstanceSingleVerifier<M>

- Type Parameters:
    `M` - See `R2ShaderTranslucentInstanceSingleType`
  All Implemented Interfaces:
    com.io7m.jcanephora.core.JCGLResourceUsableType, R2DeletableType, R2ShaderTranslucentInstanceSingleType<M>, R2ShaderTranslucentInstanceSingleUsableType<M>, R2ShaderTranslucentType<M>, R2ShaderTranslucentUsableType<M>, R2ShaderType<M>, R2ShaderUsableType<M>

      public final class R2ShaderTranslucentInstanceSingleVerifier<M>
      extends Object
      implements R2ShaderTranslucentInstanceSingleType<M>

  A delegating verifier for translucent single-instance shaders; a type that verifies that a renderer has called all of the required methods in the correct order.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Delete the current object.
    `boolean` | `isDeleted()`
    `static <M> R2ShaderTranslucentInstanceSingleType<M>` | `newVerifier(R2ShaderTranslucentInstanceSingleType<M> s)` Construct a new verifier for the given shader.
    `void` | `onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Activate the shader for rendering.
    `void` | `onDeactivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Deactivate the shader.
    `void` | `onReceiveInstanceTransformValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2MatricesInstanceSingleValuesType m)` Set shader values that are derived from the current instance transform.
    `void` | `onReceiveMaterialValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2ShaderParametersMaterialType<M> mat_parameters)` Set material values.
    `void` | `onReceiveViewValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2ShaderParametersViewType view_parameters)` Set shader values that are derived from the current view.
    `void` | `onValidate()` Validate the shader prior to executing a draw call.
    `long` | `shaderID()`
    `Class<M>` | `shaderParametersType()`
    `com.io7m.jcanephora.core.JCGLProgramShaderUsableType` | `shaderProgram()`
    `Optional<com.io7m.jcanephora.renderstate.JCGLBlendState>` | `suggestedBlendState()` A specification of the blending state with which this shader is intended to be used.

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

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

- - ### Method Detail

    - #### newVerifier

          public static <M> R2ShaderTranslucentInstanceSingleType<M> newVerifier(R2ShaderTranslucentInstanceSingleType<M> s)

      Construct a new verifier for the given shader.
      Type Parameters:
        `M` - See `R2ShaderInstanceSingleType`
      Parameters:
        `s` - The shader
      Returns:
        A new verifier

    - #### delete

          public void delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
                      throws R2Exception

      Description copied from interface: `R2DeletableType`
      Delete the current object.
      Specified by:
        `delete` in interface `R2DeletableType`
      Parameters:
        `g` - An OpenGL interface
      Throws:
        `R2Exception` - On errors

    - #### isDeleted

          public boolean isDeleted()

      Specified by:
        `isDeleted` in interface `com.io7m.jcanephora.core.JCGLResourceUsableType`

    - #### shaderID

          public long shaderID()

      Specified by:
        `shaderID` in interface `R2ShaderUsableType<M>`
      Returns:
        The unique shader ID

    - #### shaderParametersType

          public Class<M> shaderParametersType()

      Specified by:
        `shaderParametersType` in interface `R2ShaderUsableType<M>`
      Returns:
        The shader parameter type

    - #### shaderProgram

          public com.io7m.jcanephora.core.JCGLProgramShaderUsableType shaderProgram()

      Specified by:
        `shaderProgram` in interface `R2ShaderUsableType<M>`
      Returns:
        The compiled shader program

    - #### onActivate

          public void onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)

      Description copied from interface: `R2ShaderUsableType`
      Activate the shader for rendering.
      Specified by:
        `onActivate` in interface `R2ShaderUsableType<M>`
      Parameters:
        `g` - A GL interface

    - #### onValidate

          public void onValidate()
                          throws R2ExceptionShaderValidationFailed

      Description copied from interface: `R2ShaderUsableType`
      Validate the shader prior to executing a draw call. This method exists so that shader implementations can check that the caller has called all required methods before drawing.
      Specified by:
        `onValidate` in interface `R2ShaderUsableType<M>`
      Throws:
        `R2ExceptionShaderValidationFailed` - If validation fails

    - #### onDeactivate

          public void onDeactivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)

      Description copied from interface: `R2ShaderUsableType`
      Deactivate the shader.
      Specified by:
        `onDeactivate` in interface `R2ShaderUsableType<M>`
      Parameters:
        `g` - A GL interface

    - #### onReceiveViewValues

          public void onReceiveViewValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                          R2ShaderParametersViewType view_parameters)

      Description copied from interface: `R2ShaderTranslucentInstanceSingleUsableType`

      Set shader values that are derived from the current view.

      This method will be called exactly once between calls to `R2ShaderUsableType.onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type)` and `R2ShaderUsableType.onValidate()`.

      Specified by:
        `onReceiveViewValues` in interface `R2ShaderTranslucentInstanceSingleUsableType<M>`
      Parameters:
        `g` - An OpenGL interface
        `view_parameters` - The view parameters

    - #### onReceiveMaterialValues

          public void onReceiveMaterialValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                              R2ShaderParametersMaterialType<M> mat_parameters)

      Description copied from interface: `R2ShaderTranslucentInstanceSingleUsableType`

      Set material values.

      This method will be called once for each group of instances that use the material `M`.

      This method will be called after a call to `R2ShaderUsableType.onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type)` and before a call to `R2ShaderUsableType.onValidate()`.

      Specified by:
        `onReceiveMaterialValues` in interface `R2ShaderTranslucentInstanceSingleUsableType<M>`
      Parameters:
        `g` - A texture interface
        `mat_parameters` - The material parameters

    - #### onReceiveInstanceTransformValues

          public void onReceiveInstanceTransformValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                                       R2MatricesInstanceSingleValuesType m)

      Description copied from interface: `R2ShaderTranslucentInstanceSingleUsableType`

      Set shader values that are derived from the current instance transform.

      This method will be called exactly once for each single instance that uses the shader.

      This method will be called after a call to `R2ShaderUsableType.onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type)` and before a call to `R2ShaderUsableType.onValidate()`.

      Specified by:
        `onReceiveInstanceTransformValues` in interface `R2ShaderTranslucentInstanceSingleUsableType<M>`
      Parameters:
        `g` - An OpenGL interface
        `m` - The instance matrices

    - #### suggestedBlendState

          public Optional<com.io7m.jcanephora.renderstate.JCGLBlendState> suggestedBlendState()

      Description copied from interface: `R2ShaderTranslucentUsableType`
      A specification of the blending state with which this shader is intended to be used. An empty value indicates that blending is intended to be disabled.
      Specified by:
        `suggestedBlendState` in interface `R2ShaderTranslucentUsableType<M>`
      Returns:
        The blending configuration with which this shader is intended to be used

Copyright © 2017 <code@io7m.com> http://io7m.com