Yage3D.net
 

yage.resource.layer

Authors:
Eric Poggel

License:
LGPL v3

BLEND_NONE
Draw a layer or texture as completely opaque.

BLEND_ADD
Add the color values of a layer or texture to those behind it.

BLEND_AVERAGE
Average the color values of a layer or texture with those behind it.

BLEND_MULTIPLY
Mutiply the color values of a lyer or texture with those behind it.

LAYER_CULL_BACK
Cull the back faces of a layer and render the front.

LAYER_CULL_FRONT
Cull the front faces of a layer and render the back.

LAYER_DRAW_FILL
Draw a layer as complete filled-in polygons.

LAYER_DRAW_LINES
Draw a layer as Lines (a wireframe).

LAYER_DRAW_POINTS
Draw a layer as a series of points.

class Layer : yage.resource.resource.Resource;
This is old code and will be replaced once Collada becomes the default model format.

Each material is divided into one or more layers. Layers represent a single rendering pass. They can optionally have shaders that compile into a single program, multiple textures, and various other rendering attributes. If no shaders are specified, the material uses the default fixed-function OpenGL rendering mode. If Textures are supplied, the first will be used as the regular diffuse color map, the second as a normal map, and the third as an environment map. (This part still needs to be completed).

When an xml Material file is loaded, this class is used to represent each Layer defined in the file.

Color ambient ;
Property for the RGBA ambient layer color, default is Vec4f(0).

Color diffuse ;
Property for the RGBA diffuse layer color, default is Vec4f(1).

Color specular ;
Property for the RGBA specular layer color, default is Vec4f(0).

Color emissive ;
Property for the RGBA emissive layer color, default is Vec4f(0).

float specularity ;
Shininess exponential value, default is zero (no shininess).

int blend ;
Property to set the blending for this Layer.

int cull ;
Property to set whether the front or back faces of polygons are culled (invisible).

int draw ;
Property to set whether the layer is drawn as polygons, lines or points.

int width ;
Property to set the width of lines and points when the layer is rendered as such.

this();
Set layer properties to default values.

int addShader (Shader shader);
Add a Shader to this Layer. Call linkShaders() to recompile the program.

Returns:
the index of the new Shader in the Shader array.

int addTexture (GPUTexture texture, bool clamp = false, int filter = 0);
int addTexture (Texture texture);
Add a new texture to this layer and return it.

uint getShaderProgram ();
Return the OpenGL handle to the linked shader program. This value will most likely be zero unless shaders have been loaded and linked.

Shader[] getShaders ();
Return the array of shader obects used by this layer.

Texture[] getTextures ();
Get an array of all the textures of this layer.

int getProgram ();


char[] getShaderProgramLog ();
Get messages from the shader program.

void linkShaders ();
Link all vertex and fragment shaders together into a shader program.

void setUniform (char[] name, float[] values...);
void setUniform (char[] name, Vec!(2,float)[] values...);
void setUniform (char[] name, Vec3f[] values...);
void setUniform (char[] name, Vec!(4,float)[] values...);
void setUniform (char[] name, Matrix[] values...);
Set a the value of a uniform variable (or array of uniform variables) in this Layer's Shader program.

char[] toString ();
Return a string of xml for this layer.

Yage and all source files © 2005-2009 Eric Poggel
Documentation generated with CandyDoc on Sun Sep 20 01:37:10 2009