de.grogra.imp3d.gl20
Class GL20ResourceShaderPhong

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

public class GL20ResourceShaderPhong
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
GL20ResourceShaderPhong()
           
 
Method Summary
 void applyShader(boolean shadeless)
           
 void destroy()
          destroy this GL20Shader
 boolean fragmentAffectOnAlpha()
           
 GL20ResourceShaderFragment getAmbientMap()
           
 GL20ResourceShaderFragment getDiffuseMap()
           
 GL20ResourceShaderFragment getEmissiveMap()
           
 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
 GL20ResourceShaderFragment getShininessMap()
           
 GL20ResourceShaderFragment getSpecularMap()
           
 GL20ResourceShaderFragment getTransparencyDiffuseMap()
           
 GL20ResourceShaderFragment getTransparencyMap()
           
 GL20ResourceShaderFragment getTransparencyShininessMap()
           
 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 setAmbientMap(GL20ResourceShaderFragment ambientMap)
           
 void setDiffuseMap(GL20ResourceShaderFragment diffuseMap)
           
 void setEmissiveMap(GL20ResourceShaderFragment emissiveMap)
           
 boolean setShader(Shader shader)
           
 void setShininessMap(GL20ResourceShaderFragment shininessMap)
           
 void setSpecularMap(GL20ResourceShaderFragment specularMap)
           
 void setTransparencyDiffuseMap(GL20ResourceShaderFragment transparencyDiffuseMap)
           
 void setTransparencyMap(GL20ResourceShaderFragment transparencyMap)
           
 void setTransparencyShininessMap(GL20ResourceShaderFragment transparencyShininessMap)
           
 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

GL20ResourceShaderPhong

public GL20ResourceShaderPhong()
Method Detail

destroy

public void destroy()
destroy this GL20Shader


fragmentAffectOnAlpha

public boolean fragmentAffectOnAlpha()

getAmbientMap

public final GL20ResourceShaderFragment getAmbientMap()

getDiffuseMap

public final GL20ResourceShaderFragment getDiffuseMap()

getEmissiveMap

public final GL20ResourceShaderFragment getEmissiveMap()

getEnvironmentDependencies

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

Returns:

getScalarFromShader

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

getShininessMap

public final GL20ResourceShaderFragment getShininessMap()

getSpecularMap

public final GL20ResourceShaderFragment getSpecularMap()

getTransparencyDiffuseMap

public final GL20ResourceShaderFragment getTransparencyDiffuseMap()

getTransparencyMap

public final GL20ResourceShaderFragment getTransparencyMap()

getTransparencyShininessMap

public final GL20ResourceShaderFragment getTransparencyShininessMap()

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

setAmbientMap

public final void setAmbientMap(GL20ResourceShaderFragment ambientMap)

setDiffuseMap

public final void setDiffuseMap(GL20ResourceShaderFragment diffuseMap)

setEmissiveMap

public final void setEmissiveMap(GL20ResourceShaderFragment emissiveMap)

setShader

public boolean setShader(Shader shader)

setShininessMap

public final void setShininessMap(GL20ResourceShaderFragment shininessMap)

setSpecularMap

public final void setSpecularMap(GL20ResourceShaderFragment specularMap)

setTransparencyDiffuseMap

public final void setTransparencyDiffuseMap(GL20ResourceShaderFragment transparencyDiffuseMap)

setTransparencyMap

public final void setTransparencyMap(GL20ResourceShaderFragment transparencyMap)

setTransparencyShininessMap

public final void setTransparencyShininessMap(GL20ResourceShaderFragment transparencyShininessMap)

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