OgreScriptCompiler.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2009 Torus Knot Software Ltd
00008 
00009 Permission is hereby granted, free of charge, to any person obtaining a copy
00010 of this software and associated documentation files (the "Software"), to deal
00011 in the Software without restriction, including without limitation the rights
00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00013 copies of the Software, and to permit persons to whom the Software is
00014 furnished to do so, subject to the following conditions:
00015 
00016 The above copyright notice and this permission notice shall be included in
00017 all copies or substantial portions of the Software.
00018 
00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00025 THE SOFTWARE.
00026 -----------------------------------------------------------------------------
00027 */
00028 
00029 #ifndef __SCRIPTCOMPILER_H_
00030 #define __SCRIPTCOMPILER_H_
00031 
00032 #include "OgreSharedPtr.h"
00033 #include "OgreMaterial.h"
00034 #include "OgreHighLevelGpuProgram.h"
00035 #include "OgreCompositor.h"
00036 #include "OgreCompositionPass.h"
00037 #include "OgreAny.h"
00038 
00039 namespace Ogre
00040 {
00048     enum ConcreteNodeType
00049     {
00050         CNT_VARIABLE,
00051         CNT_VARIABLE_ASSIGN,
00052         CNT_WORD,
00053         CNT_IMPORT,
00054         CNT_QUOTE,
00055         CNT_LBRACE,
00056         CNT_RBRACE,
00057         CNT_COLON
00058     };
00059 
00061     struct ConcreteNode;
00062     typedef SharedPtr<ConcreteNode> ConcreteNodePtr;
00063     typedef list<ConcreteNodePtr>::type ConcreteNodeList;
00064     typedef SharedPtr<ConcreteNodeList> ConcreteNodeListPtr;
00065     struct ConcreteNode : public ScriptCompilerAlloc
00066     {
00067         String token, file;
00068         unsigned int line;
00069         ConcreteNodeType type;
00070         ConcreteNodeList children;
00071         ConcreteNode *parent;
00072     };
00073 
00075     enum AbstractNodeType
00076     {
00077         ANT_UNKNOWN,
00078         ANT_ATOM,
00079         ANT_OBJECT,
00080         ANT_PROPERTY,
00081         ANT_IMPORT,
00082         ANT_VARIABLE_SET,
00083         ANT_VARIABLE_ACCESS
00084     };
00085     class AbstractNode;
00086     typedef SharedPtr<AbstractNode> AbstractNodePtr;
00087     typedef list<AbstractNodePtr>::type AbstractNodeList;
00088     typedef SharedPtr<AbstractNodeList> AbstractNodeListPtr;
00089 
00090     class _OgreExport AbstractNode : public AbstractNodeAlloc
00091     {
00092     public:
00093         String file;
00094         unsigned int line;
00095         AbstractNodeType type;
00096         AbstractNode *parent;
00097         Any context; // A holder for translation context data
00098     public:
00099         AbstractNode(AbstractNode *ptr);
00100         virtual ~AbstractNode(){}
00102         virtual AbstractNode *clone() const = 0;
00104         virtual String getValue() const = 0;
00105     };
00106 
00108     class _OgreExport AtomAbstractNode : public AbstractNode
00109     {
00110     public:
00111         String value;
00112         uint32 id;
00113     public:
00114         AtomAbstractNode(AbstractNode *ptr);
00115         AbstractNode *clone() const;
00116         String getValue() const;
00117     private:
00118         void parseNumber() const;
00119     };
00120 
00122     class _OgreExport ObjectAbstractNode : public AbstractNode
00123     {
00124     private:
00125         map<String,String>::type mEnv;
00126     public:
00127         String name, cls;
00128         std::vector<String> bases;
00129         uint32 id;
00130         bool abstract;
00131         AbstractNodeList children;
00132         AbstractNodeList values;
00133         AbstractNodeList overrides; // For use when processing object inheritance and overriding
00134     public:
00135         ObjectAbstractNode(AbstractNode *ptr);
00136         AbstractNode *clone() const;
00137         String getValue() const;
00138 
00139         void addVariable(const String &name);
00140         void setVariable(const String &name, const String &value);
00141         std::pair<bool,String> getVariable(const String &name) const;
00142         const map<String,String>::type &getVariables() const;
00143     };
00144 
00146     class _OgreExport PropertyAbstractNode : public AbstractNode
00147     {
00148     public:
00149         String name;
00150         uint32 id;
00151         AbstractNodeList values;
00152     public:
00153         PropertyAbstractNode(AbstractNode *ptr);
00154         AbstractNode *clone() const;
00155         String getValue() const;
00156     };
00157 
00159     class _OgreExport ImportAbstractNode : public AbstractNode
00160     {
00161     public:
00162         String target, source;
00163     public:
00164         ImportAbstractNode();
00165         AbstractNode *clone() const;
00166         String getValue() const;
00167     };
00168 
00170     class _OgreExport VariableAccessAbstractNode : public AbstractNode
00171     {
00172     public:
00173         String name;
00174     public:
00175         VariableAccessAbstractNode(AbstractNode *ptr);
00176         AbstractNode *clone() const;
00177         String getValue() const;
00178     };
00179 
00180     class ScriptCompilerEvent;
00181     class ScriptCompilerListener;
00182 
00187     class _OgreExport ScriptCompiler : public ScriptCompilerAlloc
00188     {
00189     public: // Externally accessible types
00190         typedef map<String,uint32>::type IdMap;
00191 
00192         // The container for errors
00193         struct Error : public ScriptCompilerAlloc
00194         {
00195             String file, message;
00196             int line;
00197             uint32 code;
00198         };
00199         typedef SharedPtr<Error> ErrorPtr;
00200         typedef list<ErrorPtr>::type ErrorList;
00201 
00202         // These are the built-in error codes
00203         enum{
00204             CE_STRINGEXPECTED,
00205             CE_NUMBEREXPECTED,
00206             CE_FEWERPARAMETERSEXPECTED,
00207             CE_VARIABLEEXPECTED,
00208             CE_UNDEFINEDVARIABLE,
00209             CE_OBJECTNAMEEXPECTED,
00210             CE_OBJECTALLOCATIONERROR,
00211             CE_INVALIDPARAMETERS,
00212             CE_DUPLICATEOVERRIDE,
00213             CE_UNEXPECTEDTOKEN,
00214             CE_OBJECTBASENOTFOUND,
00215             CE_UNSUPPORTEDBYRENDERSYSTEM,
00216             CE_REFERENCETOANONEXISTINGOBJECT
00217         };
00218         static String formatErrorCode(uint32 code);
00219     public:
00220         ScriptCompiler();
00221         virtual ~ScriptCompiler() {}
00222 
00224 
00229         bool compile(const String &str, const String &source, const String &group);
00231         bool compile(const ConcreteNodeListPtr &nodes, const String &group);
00233         AbstractNodeListPtr _generateAST(const String &str, const String &source, bool doImports = false, bool doObjects = false, bool doVariables = false);
00235         bool _compile(AbstractNodeListPtr nodes, const String &group, bool doImports = true, bool doObjects = true, bool doVariables = true);
00237         void addError(uint32 code, const String &file, int line, const String &msg = "");
00239         void setListener(ScriptCompilerListener *listener);
00241         ScriptCompilerListener *getListener();
00243         const String &getResourceGroup() const;
00245 
00250         void addNameExclusion(const String &type);
00252         void removeNameExclusion(const String &type);
00254         bool _fireEvent(ScriptCompilerEvent *evt, void *retval);
00255     private: // Tree processing
00256         AbstractNodeListPtr convertToAST(const ConcreteNodeListPtr &nodes);
00258         void processImports(AbstractNodeListPtr &nodes);
00260         AbstractNodeListPtr loadImportPath(const String &name);
00262         AbstractNodeListPtr locateTarget(AbstractNodeList *nodes, const String &target);
00264         void processObjects(AbstractNodeList *nodes, const AbstractNodeListPtr &top);
00266         void processVariables(AbstractNodeList *nodes);
00268         void overlayObject(const AbstractNodePtr &source, ObjectAbstractNode *dest);
00270         bool isNameExcluded(const String &cls, AbstractNode *parent);
00272         void initWordMap();
00273     private:
00274         // Resource group
00275         String mGroup;
00276         // The word -> id conversion table
00277         IdMap mIds;
00278         // This is an environment map
00279         typedef map<String,String>::type Environment;
00280         Environment mEnv;
00281 
00282         typedef map<String,AbstractNodeListPtr>::type ImportCacheMap;
00283         ImportCacheMap mImports; // The set of imported scripts to avoid circular dependencies
00284         typedef multimap<String,String>::type ImportRequestMap;
00285         ImportRequestMap mImportRequests; // This holds the target objects for each script to be imported
00286 
00287         // This stores the imports of the scripts, so they are separated and can be treated specially
00288         AbstractNodeList mImportTable;
00289 
00290         // Error list
00291         ErrorList mErrors;
00292 
00293         // The listener
00294         ScriptCompilerListener *mListener;
00295     private: // Internal helper classes and processors
00296         class AbstractTreeBuilder
00297         {
00298         private:
00299             AbstractNodeListPtr mNodes;
00300             AbstractNode *mCurrent;
00301             ScriptCompiler *mCompiler;
00302         public:
00303             AbstractTreeBuilder(ScriptCompiler *compiler);
00304             const AbstractNodeListPtr &getResult() const;
00305             void visit(ConcreteNode *node);
00306             static void visit(AbstractTreeBuilder *visitor, const ConcreteNodeList &nodes);
00307         };
00308         friend class AbstractTreeBuilder;
00309     public: // Public translator definitions
00310         // This enum are built-in word id values
00311         enum
00312         {
00313             ID_ON = 1,
00314             ID_OFF = 2,
00315             ID_TRUE = 1,
00316             ID_FALSE = 2,
00317             ID_YES = 1,
00318             ID_NO = 2
00319         };  
00320     };
00321 
00327     class ScriptCompilerEvent
00328     {
00329     public:
00330         String mType;
00331 
00332         ScriptCompilerEvent(const String &type):mType(type){}
00333         virtual ~ScriptCompilerEvent(){}
00334     private: // Non-copyable
00335         ScriptCompilerEvent(const ScriptCompilerEvent&);
00336         ScriptCompilerEvent &operator = (const ScriptCompilerEvent&);
00337     };
00338 
00343     class _OgreExport ScriptCompilerListener
00344     {
00345     public:
00346         ScriptCompilerListener();
00347         virtual ~ScriptCompilerListener() {}
00348 
00350         virtual ConcreteNodeListPtr importFile(ScriptCompiler *compiler, const String &name);
00352         virtual void preConversion(ScriptCompiler *compiler, ConcreteNodeListPtr nodes);
00354 
00360         virtual bool postConversion(ScriptCompiler *compiler, const AbstractNodeListPtr&);
00362         virtual void handleError(ScriptCompiler *compiler, uint32 code, const String &file, int line, const String &msg);
00364 
00373         virtual bool handleEvent(ScriptCompiler *compiler, ScriptCompilerEvent *evt, void *retval);
00374     };
00375 
00376     class ScriptTranslator;
00377     class ScriptTranslatorManager;
00378 
00382     class _OgreExport ScriptCompilerManager : public Singleton<ScriptCompilerManager>, public ScriptLoader, public ScriptCompilerAlloc
00383     {
00384     private:
00385         OGRE_AUTO_MUTEX
00386 
00387         // A list of patterns loaded by this compiler manager
00388         StringVector mScriptPatterns;
00389 
00390         // A pointer to the listener used for compiling scripts
00391         ScriptCompilerListener *mListener;
00392 
00393         // Stores a map from object types to the translators that handle them
00394         vector<ScriptTranslatorManager*>::type mManagers;
00395 
00396         // A pointer to the built-in ScriptTranslatorManager
00397         ScriptTranslatorManager *mBuiltinTranslatorManager;
00398 
00399         // A pointer to the specific compiler instance used
00400         OGRE_THREAD_POINTER(ScriptCompiler, mScriptCompiler);
00401     public:
00402         ScriptCompilerManager();
00403         virtual ~ScriptCompilerManager();
00404 
00406         void setListener(ScriptCompilerListener *listener);
00408         ScriptCompilerListener *getListener();
00409 
00411         void addTranslatorManager(ScriptTranslatorManager *man);
00413         void removeTranslatorManager(ScriptTranslatorManager *man);
00415         void clearTranslatorManagers();
00417         ScriptTranslator *getTranslator(const AbstractNodePtr &node);
00418 
00420         void addScriptPattern(const String &pattern);
00422         const StringVector& getScriptPatterns(void) const;
00424         void parseScript(DataStreamPtr& stream, const String& groupName);
00426         Real getLoadingOrder(void) const;
00427 
00443         static ScriptCompilerManager& getSingleton(void);
00459         static ScriptCompilerManager* getSingletonPtr(void);
00460     };
00461 
00462     // Standard event types
00463     class _OgreExport PreApplyTextureAliasesScriptCompilerEvent : public ScriptCompilerEvent
00464     {
00465     public:
00466         Material *mMaterial;
00467         AliasTextureNamePairList *mAliases;
00468         static String eventType;
00469 
00470         PreApplyTextureAliasesScriptCompilerEvent(Material *material, AliasTextureNamePairList *aliases)
00471             :ScriptCompilerEvent(eventType), mMaterial(material), mAliases(aliases){}
00472     };
00473 
00474     class _OgreExport ProcessResourceNameScriptCompilerEvent : public ScriptCompilerEvent
00475     {
00476     public:
00477         enum ResourceType
00478         {
00479             TEXTURE,
00480             MATERIAL,
00481             GPU_PROGRAM,
00482             COMPOSITOR
00483         };
00484         ResourceType mResourceType;
00485         String mName;
00486         static String eventType;
00487 
00488         ProcessResourceNameScriptCompilerEvent(ResourceType resourceType, const String &name)
00489             :ScriptCompilerEvent(eventType), mResourceType(resourceType), mName(name){}     
00490     };
00491 
00492     class _OgreExport ProcessNameExclusionScriptCompilerEvent : public ScriptCompilerEvent
00493     {
00494     public:
00495         String mClass;
00496         AbstractNode *mParent;
00497         static String eventType;
00498 
00499         ProcessNameExclusionScriptCompilerEvent(const String &cls, AbstractNode *parent)
00500             :ScriptCompilerEvent(eventType), mClass(cls), mParent(parent){}     
00501     };
00502 
00503     class _OgreExport CreateMaterialScriptCompilerEvent : public ScriptCompilerEvent
00504     {
00505     public:
00506         String mFile, mName, mResourceGroup;
00507         static String eventType;
00508 
00509         CreateMaterialScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
00510             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup){}  
00511     };
00512 
00513     class _OgreExport CreateGpuProgramScriptCompilerEvent : public ScriptCompilerEvent
00514     {
00515     public:
00516         String mFile, mName, mResourceGroup, mSource, mSyntax;
00517         GpuProgramType mProgramType;
00518         static String eventType;
00519 
00520         CreateGpuProgramScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup, const String &source, 
00521             const String &syntax, GpuProgramType programType)
00522             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup), mSource(source), 
00523              mSyntax(syntax), mProgramType(programType)
00524         {}  
00525     };
00526 
00527     class _OgreExport CreateHighLevelGpuProgramScriptCompilerEvent : public ScriptCompilerEvent
00528     {
00529     public:
00530         String mFile, mName, mResourceGroup, mSource, mLanguage;
00531         GpuProgramType mProgramType;
00532         static String eventType;
00533 
00534         CreateHighLevelGpuProgramScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup, const String &source, 
00535             const String &language, GpuProgramType programType)
00536             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup), mSource(source), 
00537              mLanguage(language), mProgramType(programType)
00538         {}  
00539     };
00540 
00541     class _OgreExport CreateGpuSharedParametersScriptCompilerEvent : public ScriptCompilerEvent
00542     {
00543     public:
00544         String mFile, mName, mResourceGroup;
00545         static String eventType;
00546 
00547         CreateGpuSharedParametersScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
00548             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup){}  
00549     };
00550 
00551     class _OgreExport CreateParticleSystemScriptCompilerEvent : public ScriptCompilerEvent
00552     {
00553     public:
00554         String mFile, mName, mResourceGroup;
00555         static String eventType;
00556 
00557         CreateParticleSystemScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
00558             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup){}  
00559     };
00560 
00561     class _OgreExport CreateCompositorScriptCompilerEvent : public ScriptCompilerEvent
00562     {
00563     public:
00564         String mFile, mName, mResourceGroup;
00565         static String eventType;
00566 
00567         CreateCompositorScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
00568             :ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup){}  
00569     };
00570 
00572     enum
00573     {
00574         ID_MATERIAL = 3,
00575         ID_VERTEX_PROGRAM,
00576         ID_GEOMETRY_PROGRAM,
00577         ID_FRAGMENT_PROGRAM,
00578         ID_TECHNIQUE,
00579         ID_PASS,
00580         ID_TEXTURE_UNIT,
00581         ID_VERTEX_PROGRAM_REF,
00582         ID_GEOMETRY_PROGRAM_REF,
00583         ID_FRAGMENT_PROGRAM_REF,
00584         ID_SHADOW_CASTER_VERTEX_PROGRAM_REF,
00585         ID_SHADOW_RECEIVER_VERTEX_PROGRAM_REF,
00586         ID_SHADOW_RECEIVER_FRAGMENT_PROGRAM_REF,
00587         ID_SHADOW_CASTER_MATERIAL,
00588         ID_SHADOW_RECEIVER_MATERIAL,
00589         
00590         ID_LOD_VALUES,
00591         ID_LOD_STRATEGY,
00592         ID_LOD_DISTANCES,
00593         ID_RECEIVE_SHADOWS,
00594         ID_TRANSPARENCY_CASTS_SHADOWS,
00595         ID_SET_TEXTURE_ALIAS,
00596 
00597         ID_SOURCE,
00598         ID_SYNTAX,
00599         ID_DEFAULT_PARAMS,
00600         ID_PARAM_INDEXED,
00601         ID_PARAM_NAMED,
00602         ID_PARAM_INDEXED_AUTO,
00603         ID_PARAM_NAMED_AUTO,
00604 
00605         ID_SCHEME,
00606         ID_LOD_INDEX,
00607         ID_GPU_VENDOR_RULE,
00608         ID_GPU_DEVICE_RULE,
00609         ID_INCLUDE, 
00610         ID_EXCLUDE, 
00611 
00612         ID_AMBIENT,
00613         ID_DIFFUSE,
00614         ID_SPECULAR,
00615         ID_EMISSIVE,
00616             ID_VERTEXCOLOUR,
00617         ID_SCENE_BLEND,
00618             ID_COLOUR_BLEND,
00619             ID_ONE,
00620             ID_ZERO,
00621             ID_DEST_COLOUR,
00622             ID_SRC_COLOUR,
00623             ID_ONE_MINUS_DEST_COLOUR,
00624             ID_ONE_MINUS_SRC_COLOUR,
00625             ID_DEST_ALPHA,
00626             ID_SRC_ALPHA,
00627             ID_ONE_MINUS_DEST_ALPHA,
00628             ID_ONE_MINUS_SRC_ALPHA,
00629         ID_SEPARATE_SCENE_BLEND,
00630         ID_SCENE_BLEND_OP,
00631             ID_REVERSE_SUBTRACT,
00632             ID_MIN,
00633             ID_MAX,
00634         ID_SEPARATE_SCENE_BLEND_OP,
00635         ID_DEPTH_CHECK,
00636         ID_DEPTH_WRITE,
00637         ID_DEPTH_FUNC,
00638         ID_DEPTH_BIAS,
00639         ID_ITERATION_DEPTH_BIAS,
00640             ID_ALWAYS_FAIL,
00641             ID_ALWAYS_PASS,
00642             ID_LESS_EQUAL,
00643             ID_LESS,
00644             ID_EQUAL,
00645             ID_NOT_EQUAL,
00646             ID_GREATER_EQUAL,
00647             ID_GREATER,
00648         ID_ALPHA_REJECTION,
00649         ID_ALPHA_TO_COVERAGE,
00650         ID_LIGHT_SCISSOR,
00651         ID_LIGHT_CLIP_PLANES,
00652         ID_TRANSPARENT_SORTING,
00653         ID_ILLUMINATION_STAGE,
00654             ID_DECAL,
00655         ID_CULL_HARDWARE,
00656             ID_CLOCKWISE,
00657             ID_ANTICLOCKWISE,
00658         ID_CULL_SOFTWARE,
00659             ID_BACK,
00660             ID_FRONT,
00661         ID_NORMALISE_NORMALS,
00662         ID_LIGHTING,
00663         ID_SHADING,
00664             ID_FLAT, 
00665             ID_GOURAUD,
00666             ID_PHONG,
00667         ID_POLYGON_MODE,
00668             ID_SOLID,
00669             ID_WIREFRAME,
00670             ID_POINTS,
00671         ID_POLYGON_MODE_OVERRIDEABLE,
00672         ID_FOG_OVERRIDE,
00673             ID_NONE,
00674             ID_LINEAR,
00675             ID_EXP,
00676             ID_EXP2,
00677         ID_COLOUR_WRITE,
00678         ID_MAX_LIGHTS,
00679         ID_START_LIGHT,
00680         ID_ITERATION,
00681             ID_ONCE,
00682             ID_ONCE_PER_LIGHT,
00683             ID_PER_LIGHT,
00684             ID_PER_N_LIGHTS,
00685             ID_POINT,
00686             ID_SPOT,
00687             ID_DIRECTIONAL,
00688         ID_POINT_SIZE,
00689         ID_POINT_SPRITES,
00690         ID_POINT_SIZE_ATTENUATION,
00691         ID_POINT_SIZE_MIN,
00692         ID_POINT_SIZE_MAX,
00693 
00694         ID_TEXTURE_ALIAS,
00695         ID_TEXTURE,
00696             ID_1D,
00697             ID_2D,
00698             ID_3D,
00699             ID_CUBIC,
00700             ID_UNLIMITED,
00701             ID_ALPHA,
00702             ID_GAMMA,
00703         ID_ANIM_TEXTURE,
00704         ID_CUBIC_TEXTURE,
00705             ID_SEPARATE_UV,
00706             ID_COMBINED_UVW,
00707         ID_TEX_COORD_SET,
00708         ID_TEX_ADDRESS_MODE,
00709             ID_WRAP,
00710             ID_CLAMP,
00711             ID_BORDER,
00712             ID_MIRROR,
00713         ID_TEX_BORDER_COLOUR,
00714         ID_FILTERING,
00715             ID_BILINEAR,
00716             ID_TRILINEAR,
00717             ID_ANISOTROPIC,
00718         ID_MAX_ANISOTROPY,
00719         ID_MIPMAP_BIAS,
00720         ID_COLOUR_OP,
00721             ID_REPLACE,
00722             ID_ADD,
00723             ID_MODULATE,
00724             ID_ALPHA_BLEND,
00725         ID_COLOUR_OP_EX,
00726             ID_SOURCE1,
00727             ID_SOURCE2,
00728             ID_MODULATE_X2,
00729             ID_MODULATE_X4,
00730             ID_ADD_SIGNED,
00731             ID_ADD_SMOOTH,
00732             ID_SUBTRACT,
00733             ID_BLEND_DIFFUSE_COLOUR,
00734             ID_BLEND_DIFFUSE_ALPHA,
00735             ID_BLEND_TEXTURE_ALPHA,
00736             ID_BLEND_CURRENT_ALPHA,
00737             ID_BLEND_MANUAL,
00738             ID_DOT_PRODUCT,
00739             ID_SRC_CURRENT,
00740             ID_SRC_TEXTURE,
00741             ID_SRC_DIFFUSE,
00742             ID_SRC_SPECULAR,
00743             ID_SRC_MANUAL,
00744         ID_COLOUR_OP_MULTIPASS_FALLBACK,
00745         ID_ALPHA_OP_EX,
00746         ID_ENV_MAP,
00747             ID_SPHERICAL,
00748             ID_PLANAR,
00749             ID_CUBIC_REFLECTION,
00750             ID_CUBIC_NORMAL,
00751         ID_SCROLL,
00752         ID_SCROLL_ANIM,
00753         ID_ROTATE,
00754         ID_ROTATE_ANIM,
00755         ID_SCALE,
00756         ID_WAVE_XFORM,
00757             ID_SCROLL_X,
00758             ID_SCROLL_Y,
00759             ID_SCALE_X,
00760             ID_SCALE_Y,
00761             ID_SINE,
00762             ID_TRIANGLE,
00763             ID_SQUARE,
00764             ID_SAWTOOTH,
00765             ID_INVERSE_SAWTOOTH,
00766         ID_TRANSFORM,
00767         ID_BINDING_TYPE,
00768             ID_VERTEX,
00769             ID_FRAGMENT,
00770         ID_CONTENT_TYPE,
00771             ID_NAMED,
00772             ID_SHADOW,
00773         ID_TEXTURE_SOURCE,
00774         ID_SHARED_PARAMS,
00775         ID_SHARED_PARAM_NAMED,
00776         ID_SHARED_PARAMS_REF,
00777 
00778         ID_PARTICLE_SYSTEM,
00779         ID_EMITTER,
00780         ID_AFFECTOR,
00781 
00782         ID_COMPOSITOR,
00783             ID_TARGET,
00784             ID_TARGET_OUTPUT,
00785 
00786             ID_INPUT,
00787                 ID_PREVIOUS,
00788                 ID_TARGET_WIDTH,
00789                 ID_TARGET_HEIGHT,
00790                 ID_TARGET_WIDTH_SCALED,
00791                 ID_TARGET_HEIGHT_SCALED,
00792             ID_COMPOSITOR_LOGIC,
00793             ID_TEXTURE_REF,
00794             ID_SCOPE_LOCAL,
00795             ID_SCOPE_CHAIN,
00796             ID_SCOPE_GLOBAL,
00797             ID_POOLED,
00798             //ID_GAMMA, - already registered for material
00799             ID_NO_FSAA,
00800             ID_ONLY_INITIAL,
00801             ID_VISIBILITY_MASK,
00802             ID_LOD_BIAS,
00803             ID_MATERIAL_SCHEME,
00804             ID_SHADOWS_ENABLED,
00805 
00806             ID_CLEAR,
00807             ID_STENCIL,
00808             ID_RENDER_SCENE,
00809             ID_RENDER_QUAD,
00810             ID_IDENTIFIER,
00811             ID_FIRST_RENDER_QUEUE,
00812             ID_LAST_RENDER_QUEUE,
00813             ID_QUAD_NORMALS,
00814                 ID_CAMERA_FAR_CORNERS_VIEW_SPACE,
00815                 ID_CAMERA_FAR_CORNERS_WORLD_SPACE,
00816 
00817             ID_BUFFERS,
00818                 ID_COLOUR,
00819                 ID_DEPTH,
00820             ID_COLOUR_VALUE,
00821             ID_DEPTH_VALUE,
00822             ID_STENCIL_VALUE,
00823 
00824             ID_CHECK,
00825             ID_COMP_FUNC,
00826             ID_REF_VALUE,
00827             ID_MASK,
00828             ID_FAIL_OP,
00829                 ID_KEEP,
00830                 ID_INCREMENT,
00831                 ID_DECREMENT,
00832                 ID_INCREMENT_WRAP,
00833                 ID_DECREMENT_WRAP,
00834                 ID_INVERT,
00835             ID_DEPTH_FAIL_OP,
00836             ID_PASS_OP,
00837             ID_TWO_SIDED,
00838         ID_END_BUILTIN_IDS
00839     };
00842 }
00843 
00844 #endif

Copyright © 2008 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:24:52