com.io7m.r2.core.shaders.provided

## Class R2LightShaderAmbientSingle

- java.lang.Object
- - com.io7m.r2.core.shaders.provided.R2AbstractShader<R2LightAmbientScreenSingle>
  - - com.io7m.r2.core.shaders.provided.R2LightShaderAmbientSingle

- All Implemented Interfaces:
    com.io7m.jcanephora.core.JCGLResourceUsableType, R2DeletableType, R2ShaderLightScreenSingleType<R2LightAmbientScreenSingle>, R2ShaderLightScreenSingleUsableType<R2LightAmbientScreenSingle>, R2ShaderLightSingleType<R2LightAmbientScreenSingle>, R2ShaderLightSingleUsableType<R2LightAmbientScreenSingle>, R2ShaderScreenType<R2LightAmbientScreenSingle>, R2ShaderScreenUsableType<R2LightAmbientScreenSingle>, R2ShaderType<R2LightAmbientScreenSingle>, R2ShaderUsableType<R2LightAmbientScreenSingle>

      public final class R2LightShaderAmbientSingle
      extends R2AbstractShader<R2LightAmbientScreenSingle>
      implements R2ShaderLightScreenSingleType<R2LightAmbientScreenSingle>

  Ambient light shader for single lights.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static R2ShaderLightSingleType<R2LightAmbientScreenSingle>` | `newShader(com.io7m.jcanephora.core.api.JCGLShadersType in_shaders, R2ShaderPreprocessingEnvironmentReadableType in_shader_env, R2IDPoolType in_pool)` Construct a new 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` | `onReceiveValues(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, R2ShaderParametersLightType<R2LightAmbientScreenSingle> light_parameters)` Set light values.
    `void` | `onValidate()` Validate the shader prior to executing a draw call.
    `Class<R2LightAmbientScreenSingle>` | `shaderParametersType()`

    - ### Methods inherited from class com.io7m.r2.core.shaders.provided.R2AbstractShader

      `delete, isDeleted, onActivate, onDeactivate, shaderID, shaderProgram`

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

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

    - ### Methods inherited from interface com.io7m.r2.core.R2DeletableType

      `delete`

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

      `onActivate, onDeactivate, shaderID, shaderProgram`

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

      `isDeleted`

- - ### Method Detail

    - #### newShader

          public static R2ShaderLightSingleType<R2LightAmbientScreenSingle> newShader(com.io7m.jcanephora.core.api.JCGLShadersType in_shaders,
                                                                                      R2ShaderPreprocessingEnvironmentReadableType in_shader_env,
                                                                                      R2IDPoolType in_pool)

      Construct a new shader.
      Parameters:
        `in_shaders` - A shader interface
        `in_shader_env` - The shader preprocessing environment
        `in_pool` - The ID pool
      Returns:
        A new shader

    - #### shaderParametersType

          public Class<R2LightAmbientScreenSingle> shaderParametersType()

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

    - #### 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<R2LightAmbientScreenSingle>`
      Throws:
        `R2ExceptionShaderValidationFailed` - If validation fails

    - #### 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<R2LightAmbientScreenSingle>`
      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<R2LightAmbientScreenSingle> 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<R2LightAmbientScreenSingle>`
      Parameters:
        `g` - An OpenGL interface
        `light_parameters` - The light parameters

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