#ifndef _pnTrianglesNode
#define _pnTrianglesNode
#include <maya/MPxHwShaderNode.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MTypeId.h>
#include "ATIext.h"
{
public:
pnTriangles();
virtual ~pnTriangles();
int prim,
unsigned int writable,
int indexCount,
const unsigned int * indexArray,
int vertexCount,
const int * vertexIDs,
const float * vertexArray,
int normalCount,
const float ** normalArrays,
int colorCount,
const float ** colorArrays,
int texCoordCount,
const float ** texCoordArrays);
static void* creator();
public:
typedef enum {
kPointLinear,
kPointCubic
} ePointMode;
typedef enum {
kNormalLinear,
kNormalQuadratic
} eNormalMode;
typedef enum
{
kPNTriangesEXT = 0,
kVertexShaderEXT = 1,
kFragmentShaderEXT = 2
} eExtension;
int maxTessellationLevel() const { return fMaxTessellationLevel; }
ePointMode pointMode() const { return fPointMode; }
eNormalMode normalMode() const { return fNormalMode; }
unsigned int subdivisions() const { return fSubdivisions; }
GLboolean extensionSupported( eExtension e ) const
{ return fExtensionSupported[e] ; }
static MObject attrEnableVertexProgram;
static MObject attrEnablePixelProgram;
protected:
unsigned int computePNTriangles(const float * vertexArray,
const float * normalArray,
const float * texCoordArray,
float * pnVertexArray,
float * pnNormalArray,
float * pnTexCoordArray,
float * pnColorArray);
void bindVertexProgram(
const MColor diffuse,
void bindFragmentProgram();
unsigned int fSubdivisions;
GLboolean fExtensionSupported[3];
ePointMode fPointMode;
eNormalMode fNormalMode;
unsigned int fMaxTessellationLevel;
int fNumTextureCoords;
int fNumNormals;
int fNumColors;
bool fWireframe;
bool fInTexturedMode;
bool fTestVertexProgram;
bool fTestFragmentProgram;
int fVertexShaderId;
int fFragmentShaderId;
};
#endif