Ignore:
Timestamp:
03/13/07 09:27:17 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h

    r2200 r2240  
    2222using namespace Ogre; 
    2323 
     24/** 
     25 @brief Structure to store path map cluster information for a subentity. 
     26*/ 
    2427struct PathMapClusters 
    2528{ 
     29        /** 
     30                @brief the number of clusters this subentity belongs to 
     31        */ 
    2632        unsigned int count; 
     33        /** 
     34                @brief the indices of the cluster this subentity belongs to. 
     35        */ 
    2736        unsigned int* clusters; 
     37        /** 
     38                @brief the name of the path map file this subentity uses 
     39        */ 
    2840        String pathMapTextureFilename; 
     41        /** 
     42                @brief the resolution of the path map file. 
     43        */ 
    2944        unsigned int pathMapResolution; 
    3045}; 
    3146 
     47/** 
     48        @brief Structure of a path map entry point. 
     49*/ 
    3250struct PathMapEntryPoint 
    3351{ 
     52        /** 
     53                @brief the position of the entry point. 
     54        */ 
    3455    Vector3 position; 
     56        /** 
     57                @brief the normal of the entry point. 
     58        */ 
    3559        Vector3 normal; 
     60        /** 
     61                @brief the probability of the entry point. 
     62        */ 
    3663        float prob; 
    3764}; 
     65 
    3866/** 
    3967        @brief Implementation of IlluminationManager in an OGRE environment. 
     
    7098        */ 
    7199        BillboardSet* findRenderableInParticleSystem(ParticleSystem* system); 
     100        /** 
     101                @brief Fires preAllUpdates for registered UpdateListeners. 
     102 
     103                This is called in each frame before updating the RenderTechniques. 
     104        */ 
    72105        void preAllUpdates(); 
     106        /** 
     107                @brief Fires postAllUpdates for registered UpdateListeners. 
     108 
     109                This is called in each frame after updating the RenderTechniques. 
     110        */ 
    73111        void postAllUpdates(); 
    74112 
     
    83121        */ 
    84122        float maxRad; 
     123        /** 
     124                @brief Size of the focusing map. 
     125 
     126                This map is used if the shadow maps should be focused. 
     127        */ 
    85128        unsigned int focusingMapSize; 
     129        /** 
     130                @brief Size of the shadow maps. 
     131        */ 
    86132        unsigned int shadowMapSize; 
     133        /** 
     134                @brief Size of area lights for soft shadows. 
     135        */ 
    87136        float areaLightRadius; 
     137        /** 
     138                @brief Sets if light space perspective shadow mapping should be used. 
     139        */ 
    88140        bool useLISPSM; 
    89         bool useVSM; 
     141        /** 
     142                @brief Sets if the shadow maps should be blurred. 
     143 
     144                Used in variance shadow mapping. 
     145        */ 
    90146        bool blurSM; 
     147        /** 
     148                @brief Sets if shadow maps should be focused. 
     149        */ 
    91150        bool focusingSM; 
     151        /** 
     152                @brief The material name that should be used during rendering the shadow maps. 
     153 
     154                There are several predefined materials that can be used to render shadow maps: 
     155                 - GTP/Basic/Depth : writes projected depth values of front facing polygons 
     156                 - GTP/Basic/DepthCCW : writes projected depth values of back facing polygons 
     157                 - GTP/Basic/Distance : writes distance values (from eyepoint) of front facing polygons 
     158                 - GTP/Basic/DistanceCCW : writes distance values (from eyepoint) of back facing polygons 
     159                 - GTP/Basic/Distance_Normalized : writes normalized distance values 
     160                        (distance values devided by projection farplane - which is set to the attenuation range in case of shadow maps) of front facing polygons 
     161                 - GTP/Basic/Distance_NormalizedCCW : writes normalized distance values of back facing polygons 
     162 
     163                 The default material is GTP/Basic/Distance_NormalizedCCW. 
     164                 Recommended materials for different light types: 
     165                 - spot and point lights : GTP/Basic/Distance_NormalizedCCW or GTP/Basic/Distance_Normalized 
     166                 - directional lights : GTP/Basic/Depth or GTP/Basic/DepthCCW 
     167        */ 
    92168        String shadowMapMaterialName; 
     169        /** 
     170                @brief Size of the phase texture. 
     171        */ 
    93172        unsigned int phaseTextureSize; 
     173        /** 
     174                @brief Stores maximum bounding radius values for each rendering run type. 
     175        */ 
    94176        std::map<RenderingRunType,float> maxRads; 
     177        /** 
     178                @brief Stores PathMapClusters structures for each subentity. 
     179 
     180                The String key is the name of the subentity. 
     181        */ 
    95182        std::map<String, PathMapClusters> pathMapClusters; 
     183        /** 
     184                @brief PathMapEntryPoint list. 
     185        */ 
    96186        std::vector<PathMapEntryPoint> pathMapEntryPoints; 
     187        /** 
     188                @brief Stores cluster size for each path map cluster. 
     189        */ 
    97190        std::vector<unsigned int> pathMapClusterLengths; 
    98191        /** 
     
    139232        */ 
    140233        std::map<String, OgreSharedRuns*> perLightRuns; 
    141  
     234        /** 
     235                @brief  
     236        */ 
    142237        std::map<GlobalTargetType, GlobalUseRenderTarget*> globalTargets; 
    143  
     238        /** 
     239                @brief Stores registered UpdateListeners. 
     240        */ 
    144241        std::vector<UpdateListener*> updateListeners; 
    145242 
    146243public: 
    147  
     244        /** 
     245                @brief Registers an UpdateListener instance. @see UpdateListener 
     246        */ 
    148247        void addUpdateListener(UpdateListener* l){updateListeners.push_back(l);} 
    149248        /** 
     
    156255        /** 
    157256                @brief retirieves the maximum bounding sphere radius with two SharedRuns can be joined. 
     257 
     258                Only valid fi all run types use the same radius. This can be set with calling setMaxJoinRadius(). 
     259                @see setMaxJoinRadius 
    158260        */ 
    159261        float getMaxJoinRadius(){return maxRad;} 
     262        /** 
     263                @brief Retirieves the maximum shared bounding sphere radius for a given run type. 
     264        */ 
    160265        float getMaxJoinRadius(RenderingRunType type){return maxRads[type];} 
    161266        /** 
    162                 @brief sets the maximum bounding sphere radius with two SharedRuns can be joined. 
     267                @brief sets the maximum bounding sphere radius with two SharedRuns can be joined for all run type. 
    163268        */ 
    164269        void setMaxJoinRadius(float rad) 
     
    176281                 
    177282        } 
     283        /** 
     284                @brief Sets the maximum shared bounding sphere radius for a given run type. 
     285        */ 
    178286        void setMaxJoinRadius(RenderingRunType type, float rad){maxRads[type] = rad;} 
     287        /** 
     288                @see focusingMapSize 
     289        */ 
    179290        void setFocusingMapSize(unsigned int size){focusingMapSize = size;} 
     291        /** 
     292                @see phaseTextureSize 
     293        */ 
    180294        void setPhaseTextureSize(unsigned int size){phaseTextureSize = size;} 
     295        /** 
     296                @see shadowMapSize 
     297        */ 
    181298        void setShadowMapSize(unsigned int size){shadowMapSize = size;} 
    182299        /** 
     
    285402        RenderingRun* getGlobalRun(RenderingRunType runType); 
    286403 
     404        // These GlobalUseRenderTargets are only used in fire render technique. Maybe it could be solved with global rendering runs too. 
    287405        GlobalUseRenderTarget* getGlobalTarget(GlobalTargetType type); 
    288406        void addGlobalTarget(GlobalTargetType type, GlobalUseRenderTarget* target); 
     407 
    289408        /** 
    290409                @brief Updates a global RenderingRun with the given type. 
     
    318437        */ 
    319438        void updatePerLightRun(String lightName, RenderingRunType runType, unsigned long frameNum); 
    320  
     439        /** 
     440                @brief Saves the phase texture to the given file. 
     441        */ 
    321442        void savePhaseTextureToFile(String filename); 
    322  
     443        /** 
     444                @brief Frame listener event handler function. 
     445                 
     446                Inherited from FrameListener. Called at the beginning of each frame. 
     447        */ 
    323448        bool frameStarted(const FrameEvent& evt) 
    324449    { 
    325450                update(Root::getSingleton().getCurrentFrameNumber(), mainViewport->getTarget()); 
    326451                return FrameListener::frameStarted(evt); 
    327         } 
    328  
     452        }        
     453        /** 
     454                @see useLISPSM 
     455        */ 
    329456        bool getUseLISPSM(){return useLISPSM;} 
    330         bool getUseVSM(){return useVSM;} 
     457        /** 
     458                @see focusingSM 
     459        */ 
    331460        bool getFocusingShadowMap(){return focusingSM;} 
     461        /** 
     462                @see blurSM 
     463        */ 
    332464        bool getBlurShadowMap(){return blurSM;} 
     465        /** 
     466                @see useLISPSM 
     467        */ 
    333468        void setUseLISPSM(bool use){useLISPSM = use;} 
    334         void setUseVSM(bool use){useVSM = use;} 
     469        /** 
     470                @see focusingSM 
     471        */ 
    335472        void setFocusingSM(bool use){focusingSM = use;} 
     473        /** 
     474                @see blurSM 
     475        */ 
    336476        void setBlurShadowMap(bool use){blurSM = use;} 
     477        /** 
     478                @see shadowMapMaterialName 
     479        */ 
    337480        void setShadowMapMaterialName(String name){shadowMapMaterialName = name;} 
    338  
     481        /** 
     482                @brief Registers a PathMapClusters structure for a given subentity. 
     483 
     484                @param subEntityName name of te subentity 
     485                @param clusters the PathMapClusters that belongs to the given subentity 
     486        */ 
    339487        void addPathMapClusters(String subEntityName, PathMapClusters clusters) 
    340488        { 
    341489                this->pathMapClusters[subEntityName] = clusters; 
    342490        } 
     491        /** 
     492                @brief Returns the PathMapClusters structure registered for a given subentity. 
     493 
     494                @param subEntityName name of te subentity 
     495                @return pointer to the PathMapClusters structure that belongs to the given subentity 
     496        */ 
    343497        PathMapClusters* getPathMapClusters(String subEntityName) 
    344498        { 
    345499                return &pathMapClusters[subEntityName]; 
    346500        } 
     501        /** 
     502                @brief Adds a new PathMapEntryPoint cluster to the entrypoint list. 
     503        */ 
    347504        void addPathMapEntryPoint(PathMapEntryPoint p) 
    348505        { 
    349506                this->pathMapEntryPoints.push_back(p); 
    350507        } 
     508        /** 
     509                @brief Returns the list of entrypoints. 
     510        */ 
    351511        std::vector<PathMapEntryPoint>& getPathMapEntryPoints() 
    352512        { 
    353513                return pathMapEntryPoints; 
    354514        } 
     515        /** 
     516                @brief Adds a new cluster size. 
     517        */ 
    355518        void addPathMapClusterLength(unsigned int l) 
    356519        { 
    357520                this->pathMapClusterLengths.push_back(l); 
    358521        } 
     522        /** 
     523                @brief Gets the number of clusters. 
     524        */ 
    359525        unsigned int getPathMapClusterLengthsSize() 
    360526        { 
    361527                return this->pathMapClusterLengths.size(); 
    362528        } 
     529        /** 
     530                @brief Gets the size of the given cluster. 
     531 
     532                @param index of the cluster 
     533                @return the size of the cluster 
     534        */ 
    363535        unsigned int getPathMapClusterLength(unsigned int index) 
    364536        { 
    365537                return pathMapClusterLengths.at(index); 
    366538        } 
     539        /** 
     540                @see areaLightRadius 
     541        */ 
    367542        float getAreaLightRadius(){return areaLightRadius;} 
     543        /** 
     544                @see areaLightRadius 
     545        */ 
    368546        void setAreaLigtRadius(float radius){areaLightRadius = radius;} 
    369547}; 
Note: See TracChangeset for help on using the changeset viewer.