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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:45