com.jme.scene.state
Class ShadeState

java.lang.Object
  extended bycom.jme.scene.state.RenderState
      extended bycom.jme.scene.state.ShadeState
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LWJGLShadeState

public abstract class ShadeState
extends RenderState

ShadeState maintains the interpolation of color between vertices. Smooth shades the colors with proper linear interpolation, while flat provides no smoothing.

Version:
$Id: ShadeState.java,v 1.2 2004/04/22 22:26:56 renanse Exp $
Author:
Mark Powell
See Also:
Serialized Form

Field Summary
protected  int shade
           
static int SM_FLAT
          Pick the color of just one vertex of a triangle and rasterize all pixels of the triangle with this color.
static int SM_SMOOTH
          Smoothly interpolate the color values between the three colors of the three vertices.
 
Fields inherited from class com.jme.scene.state.RenderState
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER
 
Constructor Summary
ShadeState()
          Constructor instantiates a new ShadeState object with the default mode being smooth.
 
Method Summary
 int getShade()
          getShade returns the current shading state.
 int getType()
          getType returns this type of this render state.
 void setShade(int shade)
          setShade sets the current shading state.
 
Methods inherited from class com.jme.scene.state.RenderState
apply, extract, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SM_FLAT

public static final int SM_FLAT
Pick the color of just one vertex of a triangle and rasterize all pixels of the triangle with this color.

See Also:
Constant Field Values

SM_SMOOTH

public static final int SM_SMOOTH
Smoothly interpolate the color values between the three colors of the three vertices.

See Also:
Constant Field Values

shade

protected int shade
Constructor Detail

ShadeState

public ShadeState()
Constructor instantiates a new ShadeState object with the default mode being smooth.

Method Detail

getShade

public int getShade()
getShade returns the current shading state.

Returns:
the current shading state.

setShade

public void setShade(int shade)
setShade sets the current shading state. If an invalid value is passed, the shade is set to SM_SMOOTH.

Parameters:
shade - the current shading state.

getType

public int getType()
getType returns this type of this render state. (RS_SHADE).

Specified by:
getType in class RenderState
Returns:
An int identifying this render state.
See Also:
RenderState.getType()