com.io7m.r2.core.shaders.types

## Class R2ShaderLightProjectiveWithShadowVerifier<M extends R2LightProjectiveWithShadowReadableType>

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

- Type Parameters:
    `M` - See `R2ShaderLightProjectiveType`
  All Implemented Interfaces:
    com.io7m.jcanephora.core.JCGLResourceUsableType, R2DeletableType, R2ShaderLightProjectiveUsableType<M>, R2ShaderLightProjectiveWithShadowType<M>, R2ShaderLightProjectiveWithShadowUsableType<M>, R2ShaderLightSingleUsableType<M>, R2ShaderLightVolumeSingleType<M>, R2ShaderLightVolumeSingleUsableType<M>, R2ShaderType<M>, R2ShaderUsableType<M>

      public final class R2ShaderLightProjectiveWithShadowVerifier<M extends R2LightProjectiveWithShadowReadableType>
      extends Object
      implements R2ShaderLightProjectiveWithShadowType<M>

  A verifier for projective light 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 extends R2LightProjectiveWithShadowReadableType> R2ShaderLightProjectiveWithShadowType<M>` | `newVerifier(R2ShaderLightProjectiveWithShadowType<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` | `onReceiveBoundGeometryBufferTextures(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2GeometryBufferUsableType gbuffer, com.io7m.jcanephora.core.JCGLTextureUnitType unit_albedo, com.io7m.jcanephora.core.JCGLTextureUnitType unit_specular, com.io7m.jcanephora.core.JCGLTextureUnitType unit_depth, com.io7m.jcanephora.core.JCGLTextureUnitType unit_normals)` Set the bound geometry buffer textures for the current shader.
    `void` | `onReceiveProjectiveLight(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2MatricesProjectiveLightValuesType m)` Set shader values that are derived from the current projective light.
    `void` | `onReceiveShadowMap(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, com.io7m.jcanephora.texture_unit_allocator.JCGLTextureUnitContextMutableType tc, R2Texture2DUsableType map)` Set values from the given shadow map context.
    `void` | `onReceiveValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2ShaderParametersLightType<M> light_parameters)` Set light values.
    `void` | `onReceiveVolumeLightTransform(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2MatricesVolumeLightValuesType m)` Set shader values that are derived from the current volume light transform.
    `void` | `onValidate()` Validate the shader prior to executing a draw call.
    `long` | `shaderID()`
    `Class<M>` | `shaderParametersType()`
    `com.io7m.jcanephora.core.JCGLProgramShaderUsableType` | `shaderProgram()`

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

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

- - ### Method Detail

    - #### newVerifier

          public static <M extends R2LightProjectiveWithShadowReadableType> R2ShaderLightProjectiveWithShadowType<M> newVerifier(R2ShaderLightProjectiveWithShadowType<M> s)

      Construct a new verifier for the given shader.
      Type Parameters:
        `M` - See `R2LightProjectiveWithShadowReadableType`
      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 extends R2LightProjectiveWithShadowReadableType>`
      Returns:
        The unique shader ID

    - #### shaderParametersType

          public Class<M> shaderParametersType()

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

    - #### shaderProgram

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

      Specified by:
        `shaderProgram` in interface `R2ShaderUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      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 extends R2LightProjectiveWithShadowReadableType>`
      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 extends R2LightProjectiveWithShadowReadableType>`
      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 extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - A GL interface

    - #### onReceiveBoundGeometryBufferTextures

          public void onReceiveBoundGeometryBufferTextures(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                                           R2GeometryBufferUsableType gbuffer,
                                                           com.io7m.jcanephora.core.JCGLTextureUnitType unit_albedo,
                                                           com.io7m.jcanephora.core.JCGLTextureUnitType unit_specular,
                                                           com.io7m.jcanephora.core.JCGLTextureUnitType unit_depth,
                                                           com.io7m.jcanephora.core.JCGLTextureUnitType unit_normals)

      Description copied from interface: `R2ShaderLightSingleUsableType`

      Set the bound geometry buffer textures for the current shader.

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

      Specified by:
        `onReceiveBoundGeometryBufferTextures` in interface `R2ShaderLightSingleUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - An OpenGL interface
        `gbuffer` - The geometry buffer
        `unit_albedo` - The texture unit to which the geometry buffer's albedo/emissive texture is bound
        `unit_specular` - The texture unit to which the geometry buffer's specular texture is bound
        `unit_depth` - The texture unit to which the geometry buffer's depth/stencil texture is bound
        `unit_normals` - The texture unit to which the geometry buffer's normal

    - #### onReceiveValues

          public void onReceiveValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                      R2ShaderParametersLightType<M> light_parameters)

      Description copied from interface: `R2ShaderLightSingleUsableType`

      Set light values.

      This method will be called once for each light that uses the current 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:
        `onReceiveValues` in interface `R2ShaderLightSingleUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - An OpenGL interface
        `light_parameters` - The light parameters

    - #### onReceiveVolumeLightTransform

          public void onReceiveVolumeLightTransform(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                                    R2MatricesVolumeLightValuesType m)

      Description copied from interface: `R2ShaderLightVolumeSingleUsableType`

      Set shader values that are derived from the current volume light transform.

      This method will be called exactly once for each light 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:
        `onReceiveVolumeLightTransform` in interface `R2ShaderLightVolumeSingleUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - An OpenGL interface
        `m` - The instance matrices

    - #### onReceiveProjectiveLight

          public void onReceiveProjectiveLight(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                               R2MatricesProjectiveLightValuesType m)

      Description copied from interface: `R2ShaderLightProjectiveUsableType`

      Set shader values that are derived from the current projective light.

      This method will be called once for each projective light that uses the current 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:
        `onReceiveProjectiveLight` in interface `R2ShaderLightProjectiveUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - An OpenGL interface
        `m` - The instance matrices

    - #### onReceiveShadowMap

          public void onReceiveShadowMap(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                         com.io7m.jcanephora.texture_unit_allocator.JCGLTextureUnitContextMutableType tc,
                                         R2Texture2DUsableType map)

      Description copied from interface: `R2ShaderLightProjectiveWithShadowUsableType`

      Set values from the given shadow map context.

      This method will be called once for each projective light that uses the current 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:
        `onReceiveShadowMap` in interface `R2ShaderLightProjectiveWithShadowUsableType<M extends R2LightProjectiveWithShadowReadableType>`
      Parameters:
        `g` - An OpenGL interface
        `tc` - A texture unit context
        `map` - A rendered shadow map

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