artofillusion.view
Class ParameterVertexShader

java.lang.Object
  extended by artofillusion.view.ParameterVertexShader
All Implemented Interfaces:
VertexShader

public class ParameterVertexShader
extends java.lang.Object
implements VertexShader

This is a VertexShader which colors the surface based on the value of a TextureParameter.


Constructor Summary
ParameterVertexShader(RenderingMesh mesh, ParameterValue param, RGBColor lowColor, RGBColor highColor, double minValue, double maxValue, Vec3 viewDir)
          Create a ParameterVertexShader for a mesh.
 
Method Summary
 void getColor(int face, int vertex, RGBColor color)
          Select the color for a vertex.
 void getTextureSpec(TextureSpec spec)
          Get the color of the surface.
 boolean isUniformFace(int face)
          Get whether a particular face should be rendered with a single uniform color.
 boolean isUniformTexture()
          Get whether this shader represents a uniform texture.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterVertexShader

public ParameterVertexShader(RenderingMesh mesh,
                             ParameterValue param,
                             RGBColor lowColor,
                             RGBColor highColor,
                             double minValue,
                             double maxValue,
                             Vec3 viewDir)
Create a ParameterVertexShader for a mesh.

Parameters:
mesh - the mesh to render
param - the ParameterValue by which to color the mesh
lowColor - the color to display for low values of the parameter
highColor - the color to display for high values of the parameter
minValue - the minimum value the parameter can have
maxValue - the maximum value the parameter can have
viewDir - the direction from which it is being viewed
Method Detail

getColor

public void getColor(int face,
                     int vertex,
                     RGBColor color)
Select the color for a vertex.

Specified by:
getColor in interface VertexShader
Parameters:
face - the index of the triangle being rendered
vertex - the index of the vertex to color
color - the vertex color will be returned in this object

isUniformFace

public boolean isUniformFace(int face)
Get whether a particular face should be rendered with a single uniform color.

Specified by:
isUniformFace in interface VertexShader
Parameters:
face - the index of the triangle being rendered

isUniformTexture

public boolean isUniformTexture()
Get whether this shader represents a uniform texture. If this returns true, all texture properties are uniform over the entire surface (although different parts may still be colored differently due to lighting).

Specified by:
isUniformTexture in interface VertexShader

getTextureSpec

public void getTextureSpec(TextureSpec spec)
Get the color of the surface. This should only be called if isUniformTexture() returns true.

Specified by:
getTextureSpec in interface VertexShader
Parameters:
spec - the surface color will be returned in this object


Copyright © 1999-2011 by Peter Eastman.