de.grogra.imp3d.gl20
Class GL20ResourceShaderRGBA

java.lang.Object
  extended by de.grogra.imp3d.gl20.GL20Resource
      extended by de.grogra.imp3d.gl20.GL20ResourceShaderRGBA

public class GL20ResourceShaderRGBA
extends GL20Resource


Field Summary
static int NEEDS_LIGHTS
          shader need information about lights
static int NEEDS_NORMAL
          shader need normals for calculation
static int NEEDS_TEXCOORD
          shader need texture coordinats for calculation
static int NEEDS_WORLD_TO_VIEW_MATRIX
          shader need the world-to-view matrix
static int NON_OPAQUE
          shader can produce transparent fragments
 
Fields inherited from class de.grogra.imp3d.gl20.GL20Resource
GL20RESOURCE_CLASS_LIGHT, GL20RESOURCE_CLASS_MASK, GL20RESOURCE_CLASS_MESH, GL20RESOURCE_CLASS_SHADER, GL20RESOURCE_CLASS_SHADERFRAGMENT, GL20RESOURCE_CLASS_SHAPE, GL20RESOURCE_CLASS_TEXTURE, GL20RESOURCE_LIGHT_DIRECTIONAL, GL20RESOURCE_LIGHT_POINT, GL20RESOURCE_LIGHT_SPOT, GL20RESOURCE_MESH_MULTI_USER, GL20RESOURCE_MESH_SINGLE_USER, GL20RESOURCE_SHADER_PHONG, GL20RESOURCE_SHADER_RGBA, GL20RESOURCE_SHADERFRAGMENT_BLEND, GL20RESOURCE_SHADERFRAGMENT_GRAYTONE, GL20RESOURCE_SHADERFRAGMENT_RGB, GL20RESOURCE_SHAPE_BOX, GL20RESOURCE_SHAPE_FRUSTUM, GL20RESOURCE_SHAPE_LINE, GL20RESOURCE_SHAPE_LINE_STRIP, GL20RESOURCE_SHAPE_PARALLELOGRAM, GL20RESOURCE_SHAPE_PLANE, GL20RESOURCE_SHAPE_POLYGONS, GL20RESOURCE_SHAPE_SPHERE, GL20RESOURCE_TEXTURE, GL20RESOURCE_TEXTURE_CUBEMAP, GL20RESOURCE_TYPE_MASK
 
Constructor Summary
GL20ResourceShaderRGBA()
           
GL20ResourceShaderRGBA(float red, float green, float blue)
           
 
Method Summary
 void applyShader(boolean shadeless)
           
 void destroy()
          destroy this GL20Shader
 Vector4f getColor()
           
 int getEnvironmentDependencies()
          get the environment dependencies for this GL20ResourceShader
 int getScalarFromShader(de.grogra.imp3d.gl20.GL20GLSLCode code, int channel)
           
 Shader getShader()
          return the equivalent Shader
 int getVector3FromShader(de.grogra.imp3d.gl20.GL20GLSLCode code, int startChannel)
           
 int getVector4FromShader(de.grogra.imp3d.gl20.GL20GLSLCode code, int startChannel)
           
 boolean isUpToDate()
          check if this GL20ResourceShader is up to date
 void registerUser()
           
 void setColor(Vector4f color)
           
 boolean setShader(Shader shader)
           
 void unregisterUser()
           
 void update()
          update this GL20ResourceShader
 
Methods inherited from class de.grogra.imp3d.gl20.GL20Resource
getResourceClass, getResourceClassType, getResourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEEDS_LIGHTS

public static final int NEEDS_LIGHTS
shader need information about lights

See Also:
Constant Field Values

NEEDS_NORMAL

public static final int NEEDS_NORMAL
shader need normals for calculation

See Also:
Constant Field Values

NEEDS_TEXCOORD

public static final int NEEDS_TEXCOORD
shader need texture coordinats for calculation

See Also:
Constant Field Values

NEEDS_WORLD_TO_VIEW_MATRIX

public static final int NEEDS_WORLD_TO_VIEW_MATRIX
shader need the world-to-view matrix

See Also:
Constant Field Values

NON_OPAQUE

public static final int NON_OPAQUE
shader can produce transparent fragments

See Also:
Constant Field Values
Constructor Detail

GL20ResourceShaderRGBA

public GL20ResourceShaderRGBA()

GL20ResourceShaderRGBA

public GL20ResourceShaderRGBA(float red,
                              float green,
                              float blue)
Method Detail

destroy

public void destroy()
destroy this GL20Shader


getColor

public Vector4f getColor()

getEnvironmentDependencies

public int getEnvironmentDependencies()
get the environment dependencies for this GL20ResourceShader

Returns:

getScalarFromShader

public int getScalarFromShader(de.grogra.imp3d.gl20.GL20GLSLCode code,
                               int channel)

getVector3FromShader

public int getVector3FromShader(de.grogra.imp3d.gl20.GL20GLSLCode code,
                                int startChannel)

getVector4FromShader

public int getVector4FromShader(de.grogra.imp3d.gl20.GL20GLSLCode code,
                                int startChannel)

isUpToDate

public boolean isUpToDate()
check if this GL20ResourceShader is up to date

Returns:
true this GL20ResourceShader is up to date false this GL20ResourceShader is not up to date, need an update() call
See Also:
update()

setColor

public void setColor(Vector4f color)

setShader

public boolean setShader(Shader shader)

update

public void update()
update this GL20ResourceShader


applyShader

public void applyShader(boolean shadeless)

getShader

public final Shader getShader()
return the equivalent Shader

Returns:
the equivalent Shader

registerUser

public void registerUser()

unregisterUser

public void unregisterUser()