com.io7m.r2.core.shaders.types

## Interface R2ShaderLightSingleUsableType<M extends R2LightSingleReadableType>

- Type Parameters:
    `M` - The type of shader parameters
  All Superinterfaces:
    com.io7m.jcanephora.core.JCGLResourceUsableType, R2ShaderUsableType<M>
  All Known Subinterfaces:
    R2ShaderLightProjectiveType<M>, R2ShaderLightProjectiveUsableType<M>, R2ShaderLightProjectiveWithShadowType<M>, R2ShaderLightProjectiveWithShadowUsableType<M>, R2ShaderLightScreenSingleType<M>, R2ShaderLightScreenSingleUsableType<M>, R2ShaderLightSingleType<M>, R2ShaderLightVolumeSingleType<M>, R2ShaderLightVolumeSingleUsableType<M>
  All Known Implementing Classes:
    R2DebugShaderLightDirectionalConstantSingle, R2DebugShaderLightSphericalAttenuationSingle, R2DebugShaderLightSphericalConstantSingle, R2LightShaderAmbientSingle, R2LightShaderDirectionalSpecularSingle, R2LightShaderProjectiveLambertBlinnPhongShadowVarianceSingle, R2LightShaderProjectiveLambertBlinnPhongSingle, R2LightShaderProjectiveLambertShadowVarianceSingle, R2LightShaderProjectiveLambertSingle, R2LightShaderSphericalLambertBlinnPhongSingle, R2LightShaderSphericalLambertPhongSingle, R2LightShaderSphericalLambertSingle, R2ShaderLightProjectiveVerifier, R2ShaderLightProjectiveWithShadowVerifier, R2ShaderLightScreenSingleVerifier, R2ShaderLightVolumeSingleVerifier

      public interface R2ShaderLightSingleUsableType<M extends R2LightSingleReadableType>
      extends R2ShaderUsableType<M>

  The type of usable single-instance light shaders.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `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` | `onReceiveValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2ShaderParametersLightType<M> light_parameters)` Set light values.

    - ### Methods inherited from interface com.io7m.r2.core.shaders.types.R2ShaderUsableType

      `onActivate, onDeactivate, onValidate, shaderID, shaderParametersType, shaderProgram`

    - ### Methods inherited from interface com.io7m.jcanephora.core.JCGLResourceUsableType

      `isDeleted`

- - ### Method Detail

    - #### onReceiveBoundGeometryBufferTextures

          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.

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

      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

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

      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()`.

      Parameters:
        `g` - An OpenGL interface
        `light_parameters` - The light parameters

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