com.metsci.glimpse.support.shader
Class SampledColorScaleShader

java.lang.Object
  extended by com.metsci.glimpse.gl.shader.Shader
      extended by com.metsci.glimpse.support.shader.SampledColorScaleShader
All Implemented Interfaces:
AxisListener1D
Direct Known Subclasses:
SampledColorScaleShaderInteger

public class SampledColorScaleShader
extends Shader
implements AxisListener1D

A shader which colors a 2D data texture using values sampled from a color scaled defined by a 1D color texture.

Author:
ulman

Constructor Summary
SampledColorScaleShader(Axis1D colorAxis, int targetTexUnit, int colorTexUnit)
           
 
Method Summary
 void axisUpdated(Axis1D axis)
           
 void postDisplay(javax.media.opengl.GL gl)
          Called right after rendering is complete, just after reverting to the fixed pipeline functionality.
 void preDisplay(javax.media.opengl.GL gl)
          Called right after this shader is made current as part of the pipeline.
 boolean preLink(javax.media.opengl.GL gl, int glProgramHandle)
          Called right after the program has been compiled, but before it has been linked.
 void setAlpha(float alpha)
           
 void setColorTexUnit(int unit)
           
 void setTargetTexUnit(int unit)
           
 
Methods inherited from class com.metsci.glimpse.gl.shader.Shader
dispose, getName, getSource, getType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SampledColorScaleShader

public SampledColorScaleShader(Axis1D colorAxis,
                               int targetTexUnit,
                               int colorTexUnit)
                        throws java.io.IOException
Parameters:
colorAxis - color axis producing events
targetTexUnit - 2D texture unit which is the target of color-mapping
colorTexUnit - 1D texture unit containing color-map
Throws:
java.io.IOException - if the shader source file cannot be read
Method Detail

setAlpha

public void setAlpha(float alpha)

preLink

public boolean preLink(javax.media.opengl.GL gl,
                       int glProgramHandle)
Description copied from class: Shader
Called right after the program has been compiled, but before it has been linked.

Specified by:
preLink in class Shader
Returns:
false if any problems specific to this shader are found, true otherwise

preDisplay

public void preDisplay(javax.media.opengl.GL gl)
Description copied from class: Shader
Called right after this shader is made current as part of the pipeline. Use this method to update uniform variables for this shader.

Specified by:
preDisplay in class Shader

postDisplay

public void postDisplay(javax.media.opengl.GL gl)
Description copied from class: Shader
Called right after rendering is complete, just after reverting to the fixed pipeline functionality. Use this method for any necessary cleanup specific to this shader.

Specified by:
postDisplay in class Shader

axisUpdated

public void axisUpdated(Axis1D axis)
Specified by:
axisUpdated in interface AxisListener1D

setTargetTexUnit

public void setTargetTexUnit(int unit)

setColorTexUnit

public void setColorTexUnit(int unit)


Copyright © 2012 Metron, Inc.. All Rights Reserved.