de.grogra.imp3d.gl20
Class GL20ResourceShaderFragmentGraytone

java.lang.Object
  extended by de.grogra.imp3d.gl20.GL20Resource
      extended by de.grogra.imp3d.gl20.GL20ResourceShaderFragment
          extended by de.grogra.imp3d.gl20.GL20ResourceShaderFragmentGraytone

public class GL20ResourceShaderFragmentGraytone
extends GL20ResourceShaderFragment


Field Summary
 
Fields inherited from class de.grogra.imp3d.gl20.GL20ResourceShaderFragment
GL20CHANNEL_A, GL20CHANNEL_A_BIT, GL20CHANNEL_B, GL20CHANNEL_B_BIT, GL20CHANNEL_DERIVATE_BITS, GL20CHANNEL_DERIVATE_DU_BITS, GL20CHANNEL_DERIVATE_DV_BITS, GL20CHANNEL_DERIVATE_MAX, GL20CHANNEL_DERIVATE_MIN, GL20CHANNEL_DERIVATE_X_DU, GL20CHANNEL_DERIVATE_X_DU_BIT, GL20CHANNEL_DERIVATE_X_DV, GL20CHANNEL_DERIVATE_X_DV_BIT, GL20CHANNEL_DERIVATE_Y_DU, GL20CHANNEL_DERIVATE_Y_DU_BIT, GL20CHANNEL_DERIVATE_Y_DV, GL20CHANNEL_DERIVATE_Y_DV_BIT, GL20CHANNEL_DERIVATE_Z_DU, GL20CHANNEL_DERIVATE_Z_DU_BIT, GL20CHANNEL_DERIVATE_Z_DV, GL20CHANNEL_DERIVATE_Z_DV_BIT, GL20CHANNEL_G, GL20CHANNEL_G_BIT, GL20CHANNEL_NORMAL_BITS, GL20CHANNEL_NORMAL_X, GL20CHANNEL_NORMAL_X_BIT, GL20CHANNEL_NORMAL_Y, GL20CHANNEL_NORMAL_Y_BIT, GL20CHANNEL_NORMAL_Z, GL20CHANNEL_NORMAL_Z_BIT, GL20CHANNEL_POSITION_BITS, GL20CHANNEL_POSITION_X, GL20CHANNEL_POSITION_X_BIT, GL20CHANNEL_POSITION_Y, GL20CHANNEL_POSITION_Y_BIT, GL20CHANNEL_POSITION_Z, GL20CHANNEL_POSITION_Z_BIT, GL20CHANNEL_R, GL20CHANNEL_R_BIT, GL20CHANNEL_RGB_BITS, GL20CHANNEL_RGBA_BITS, GL20CHANNEL_TEXCOORD_BITS, GL20CHANNEL_TEXCOORD_U, GL20CHANNEL_TEXCOORD_U_BIT, GL20CHANNEL_TEXCOORD_V, GL20CHANNEL_TEXCOORD_V_BIT, GL20CHANNEL_TEXCOORD_W, GL20CHANNEL_TEXCOORD_W_BIT, GL20CHANNEL_X, GL20CHANNEL_X_BIT, GL20CHANNEL_XYZ_BITS, GL20CHANNEL_Y, GL20CHANNEL_Y_BIT, GL20CHANNEL_Z, GL20CHANNEL_Z_BIT
 
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
GL20ResourceShaderFragmentGraytone()
           
GL20ResourceShaderFragmentGraytone(float grayValue)
           
 
Method Summary
 boolean fragmentAffectOnAlpha()
          check if this GL20ResourceShaderFragment affect the alpha channel
 int getScalarIndex(de.grogra.imp3d.gl20.GL20GLSLCode code, int channel)
          get the index of the scalar value for the code that was created
 float getValue()
           
 int getVector3Index(de.grogra.imp3d.gl20.GL20GLSLCode code, int startChannel)
          get the index of the vector3 for the code that was created
 int getVector4Index(de.grogra.imp3d.gl20.GL20GLSLCode code, int startChannel)
          get the index of the vector4 for the code that was created
 boolean isUpToDate()
          check if this GL20ResourceShaderFragment is up to date
 boolean setChannelMap(ChannelMap channelMap)
          set the equivalent ChannelMap to this GL20ResourceShaderFragment
 void setValue(float value)
           
 void update()
          update this GL20ResourceShaderFragment
 
Methods inherited from class de.grogra.imp3d.gl20.GL20ResourceShaderFragment
destroy, getChannelMap, registerUser, unregisterUser
 
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
 

Constructor Detail

GL20ResourceShaderFragmentGraytone

public GL20ResourceShaderFragmentGraytone()

GL20ResourceShaderFragmentGraytone

public GL20ResourceShaderFragmentGraytone(float grayValue)
Method Detail

fragmentAffectOnAlpha

public boolean fragmentAffectOnAlpha()
Description copied from class: GL20ResourceShaderFragment
check if this GL20ResourceShaderFragment affect the alpha channel

Specified by:
fragmentAffectOnAlpha in class GL20ResourceShaderFragment
Returns:
true this GL20ResourceShader will affect the alpha channel false this GL20ResourceShader will not affect the alpha channel

getScalarIndex

public int getScalarIndex(de.grogra.imp3d.gl20.GL20GLSLCode code,
                          int channel)
Description copied from class: GL20ResourceShaderFragment
get the index of the scalar value for the code that was created

Overrides:
getScalarIndex in class GL20ResourceShaderFragment
Parameters:
code - the class where the shader code is stored finally
channel - the channel you want
Returns:
-1 an error occurred otherwise the index of the scalar value. Test for the CONST_BIT to get the correct reference

getValue

public final float getValue()

getVector3Index

public int getVector3Index(de.grogra.imp3d.gl20.GL20GLSLCode code,
                           int startChannel)
Description copied from class: GL20ResourceShaderFragment
get the index of the vector3 for the code that was created

Overrides:
getVector3Index in class GL20ResourceShaderFragment
Parameters:
code - the class where the shader code is stored finally
startChannel - the channels you want, starting with the given channel
Returns:
-1 an error occurred otherwise the index of the vector3. Test for the CONST_BIT to get the correct reference

getVector4Index

public int getVector4Index(de.grogra.imp3d.gl20.GL20GLSLCode code,
                           int startChannel)
Description copied from class: GL20ResourceShaderFragment
get the index of the vector4 for the code that was created

Overrides:
getVector4Index in class GL20ResourceShaderFragment
Parameters:
code - the class where the shader code is stored finally
startChannel - the channels you want, starting with the given channel
Returns:
-1 an error occurred otherwise the index of the vector4. Test for the CONST_BIT to get the correct reference

isUpToDate

public boolean isUpToDate()
Description copied from class: GL20ResourceShaderFragment
check if this GL20ResourceShaderFragment is up to date

Overrides:
isUpToDate in class GL20ResourceShaderFragment
Returns:
true this GL20ResourceShaderFragment is up to date false this GL20ResourceShaderFragment is not up to date, need an update() call
See Also:
update()

setChannelMap

public boolean setChannelMap(ChannelMap channelMap)
Description copied from class: GL20ResourceShaderFragment
set the equivalent ChannelMap to this GL20ResourceShaderFragment

Overrides:
setChannelMap in class GL20ResourceShaderFragment
Parameters:
channelMap - the ChannelMap that should be the source of for this GL20ResourceShaderFragment

setValue

public final void setValue(float value)

update

public void update()
Description copied from class: GL20ResourceShaderFragment
update this GL20ResourceShaderFragment

Overrides:
update in class GL20ResourceShaderFragment