de.grogra.imp3d.glsl.light
Class GLSLSpotLight

java.lang.Object
  extended by de.grogra.imp3d.glsl.utility.GLSLShader
      extended by de.grogra.imp3d.glsl.utility.GLSLManagedShader
          extended by de.grogra.imp3d.glsl.light.GLSLLightShader
              extended by de.grogra.imp3d.glsl.light.GLSLSpotLight
All Implemented Interfaces:
GLSLOpenGLObject
Direct Known Subclasses:
GLSLSpotLightShadow

public class GLSLSpotLight
extends GLSLLightShader

Implementation of the spot light type.

Author:
Konni Hartmann

Field Summary
protected  java.lang.String col0
           
protected  java.lang.String fade_distance
           
protected  java.lang.String fade_power
           
protected  java.lang.String lightPos
           
protected  java.lang.String radientPower
           
protected  java.lang.String spotCosCutoff
           
protected  java.lang.String spotDirection
           
protected  java.lang.String spotInnerCosCutoff
           
 
Fields inherited from class de.grogra.imp3d.glsl.light.GLSLLightShader
spec, stdV
 
Fields inherited from class de.grogra.imp3d.glsl.utility.GLSLManagedShader
config
 
Constructor Summary
GLSLSpotLight()
           
 
Method Summary
 java.lang.String[] getFragmentShader(java.lang.Object sh)
           
 GLSLShader getInstance()
          For "hardcompiled" Shaders this method should return a new instance
 java.lang.String getLightFunction()
          Sets middle part of a light shader (after properties have been extracted from deferred-shading-textures
 java.lang.Class instanceFor()
           
 boolean needsRecompilation(java.lang.Object data)
          Return false if Shader depends only on Uniforms
 void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, java.lang.Object data, int shaderNo)
          Function that loads uniforms of the represented Shader.
protected  void setupShader(javax.media.opengl.GL gl, GLSLDisplay disp, java.lang.Object data)
           
 
Methods inherited from class de.grogra.imp3d.glsl.light.GLSLLightShader
canDisplayShadows, getLightShaderConfig, getVertexShader, toString
 
Methods inherited from class de.grogra.imp3d.glsl.utility.GLSLManagedShader
deleteShader, getConfig, getMaterial_stamp, setConfig, setMaterial_stamp
 
Methods inherited from class de.grogra.imp3d.glsl.utility.GLSLShader
activateShader, cleanup, getShaderProgramNumber, printProgramInfoLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

col0

protected java.lang.String col0

fade_distance

protected java.lang.String fade_distance

fade_power

protected java.lang.String fade_power

lightPos

protected java.lang.String lightPos

radientPower

protected java.lang.String radientPower

spotCosCutoff

protected java.lang.String spotCosCutoff

spotDirection

protected java.lang.String spotDirection

spotInnerCosCutoff

protected java.lang.String spotInnerCosCutoff
Constructor Detail

GLSLSpotLight

public GLSLSpotLight()
Method Detail

getFragmentShader

public java.lang.String[] getFragmentShader(java.lang.Object sh)
Specified by:
getFragmentShader in class GLSLShader
Returns:

getInstance

public GLSLShader getInstance()
Description copied from class: GLSLShader
For "hardcompiled" Shaders this method should return a new instance

Overrides:
getInstance in class GLSLShader
Returns:

getLightFunction

public java.lang.String getLightFunction()
Description copied from class: GLSLLightShader
Sets middle part of a light shader (after properties have been extracted from deferred-shading-textures

Overrides:
getLightFunction in class GLSLLightShader
Returns:

instanceFor

public java.lang.Class instanceFor()
Overrides:
instanceFor in class GLSLShader
Returns:
Class represented by this Shader

needsRecompilation

public boolean needsRecompilation(java.lang.Object data)
Description copied from class: GLSLShader
Return false if Shader depends only on Uniforms

Overrides:
needsRecompilation in class GLSLShader
Returns:
true, if Sourcecode needs to be regenerated and recompiled

setupDynamicUniforms

public void setupDynamicUniforms(javax.media.opengl.GL gl,
                                 GLSLDisplay disp,
                                 java.lang.Object data,
                                 int shaderNo)
Description copied from class: GLSLShader
Function that loads uniforms of the represented Shader.

Overrides:
setupDynamicUniforms in class GLSLLightShader
disp - GLSLDisplay that tries using this shader
data - The GroIMP-Shader-Object represented by this shader.

setupShader

protected void setupShader(javax.media.opengl.GL gl,
                           GLSLDisplay disp,
                           java.lang.Object data)
Overrides:
setupShader in class GLSLLightShader