Changeset 2240 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
- Timestamp:
- 03/13/07 09:27:17 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
r2200 r2240 22 22 using namespace Ogre; 23 23 24 /** 25 @brief Structure to store path map cluster information for a subentity. 26 */ 24 27 struct PathMapClusters 25 28 { 29 /** 30 @brief the number of clusters this subentity belongs to 31 */ 26 32 unsigned int count; 33 /** 34 @brief the indices of the cluster this subentity belongs to. 35 */ 27 36 unsigned int* clusters; 37 /** 38 @brief the name of the path map file this subentity uses 39 */ 28 40 String pathMapTextureFilename; 41 /** 42 @brief the resolution of the path map file. 43 */ 29 44 unsigned int pathMapResolution; 30 45 }; 31 46 47 /** 48 @brief Structure of a path map entry point. 49 */ 32 50 struct PathMapEntryPoint 33 51 { 52 /** 53 @brief the position of the entry point. 54 */ 34 55 Vector3 position; 56 /** 57 @brief the normal of the entry point. 58 */ 35 59 Vector3 normal; 60 /** 61 @brief the probability of the entry point. 62 */ 36 63 float prob; 37 64 }; 65 38 66 /** 39 67 @brief Implementation of IlluminationManager in an OGRE environment. … … 70 98 */ 71 99 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 */ 72 105 void preAllUpdates(); 106 /** 107 @brief Fires postAllUpdates for registered UpdateListeners. 108 109 This is called in each frame after updating the RenderTechniques. 110 */ 73 111 void postAllUpdates(); 74 112 … … 83 121 */ 84 122 float maxRad; 123 /** 124 @brief Size of the focusing map. 125 126 This map is used if the shadow maps should be focused. 127 */ 85 128 unsigned int focusingMapSize; 129 /** 130 @brief Size of the shadow maps. 131 */ 86 132 unsigned int shadowMapSize; 133 /** 134 @brief Size of area lights for soft shadows. 135 */ 87 136 float areaLightRadius; 137 /** 138 @brief Sets if light space perspective shadow mapping should be used. 139 */ 88 140 bool useLISPSM; 89 bool useVSM; 141 /** 142 @brief Sets if the shadow maps should be blurred. 143 144 Used in variance shadow mapping. 145 */ 90 146 bool blurSM; 147 /** 148 @brief Sets if shadow maps should be focused. 149 */ 91 150 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 */ 92 168 String shadowMapMaterialName; 169 /** 170 @brief Size of the phase texture. 171 */ 93 172 unsigned int phaseTextureSize; 173 /** 174 @brief Stores maximum bounding radius values for each rendering run type. 175 */ 94 176 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 */ 95 182 std::map<String, PathMapClusters> pathMapClusters; 183 /** 184 @brief PathMapEntryPoint list. 185 */ 96 186 std::vector<PathMapEntryPoint> pathMapEntryPoints; 187 /** 188 @brief Stores cluster size for each path map cluster. 189 */ 97 190 std::vector<unsigned int> pathMapClusterLengths; 98 191 /** … … 139 232 */ 140 233 std::map<String, OgreSharedRuns*> perLightRuns; 141 234 /** 235 @brief 236 */ 142 237 std::map<GlobalTargetType, GlobalUseRenderTarget*> globalTargets; 143 238 /** 239 @brief Stores registered UpdateListeners. 240 */ 144 241 std::vector<UpdateListener*> updateListeners; 145 242 146 243 public: 147 244 /** 245 @brief Registers an UpdateListener instance. @see UpdateListener 246 */ 148 247 void addUpdateListener(UpdateListener* l){updateListeners.push_back(l);} 149 248 /** … … 156 255 /** 157 256 @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 158 260 */ 159 261 float getMaxJoinRadius(){return maxRad;} 262 /** 263 @brief Retirieves the maximum shared bounding sphere radius for a given run type. 264 */ 160 265 float getMaxJoinRadius(RenderingRunType type){return maxRads[type];} 161 266 /** 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. 163 268 */ 164 269 void setMaxJoinRadius(float rad) … … 176 281 177 282 } 283 /** 284 @brief Sets the maximum shared bounding sphere radius for a given run type. 285 */ 178 286 void setMaxJoinRadius(RenderingRunType type, float rad){maxRads[type] = rad;} 287 /** 288 @see focusingMapSize 289 */ 179 290 void setFocusingMapSize(unsigned int size){focusingMapSize = size;} 291 /** 292 @see phaseTextureSize 293 */ 180 294 void setPhaseTextureSize(unsigned int size){phaseTextureSize = size;} 295 /** 296 @see shadowMapSize 297 */ 181 298 void setShadowMapSize(unsigned int size){shadowMapSize = size;} 182 299 /** … … 285 402 RenderingRun* getGlobalRun(RenderingRunType runType); 286 403 404 // These GlobalUseRenderTargets are only used in fire render technique. Maybe it could be solved with global rendering runs too. 287 405 GlobalUseRenderTarget* getGlobalTarget(GlobalTargetType type); 288 406 void addGlobalTarget(GlobalTargetType type, GlobalUseRenderTarget* target); 407 289 408 /** 290 409 @brief Updates a global RenderingRun with the given type. … … 318 437 */ 319 438 void updatePerLightRun(String lightName, RenderingRunType runType, unsigned long frameNum); 320 439 /** 440 @brief Saves the phase texture to the given file. 441 */ 321 442 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 */ 323 448 bool frameStarted(const FrameEvent& evt) 324 449 { 325 450 update(Root::getSingleton().getCurrentFrameNumber(), mainViewport->getTarget()); 326 451 return FrameListener::frameStarted(evt); 327 } 328 452 } 453 /** 454 @see useLISPSM 455 */ 329 456 bool getUseLISPSM(){return useLISPSM;} 330 bool getUseVSM(){return useVSM;} 457 /** 458 @see focusingSM 459 */ 331 460 bool getFocusingShadowMap(){return focusingSM;} 461 /** 462 @see blurSM 463 */ 332 464 bool getBlurShadowMap(){return blurSM;} 465 /** 466 @see useLISPSM 467 */ 333 468 void setUseLISPSM(bool use){useLISPSM = use;} 334 void setUseVSM(bool use){useVSM = use;} 469 /** 470 @see focusingSM 471 */ 335 472 void setFocusingSM(bool use){focusingSM = use;} 473 /** 474 @see blurSM 475 */ 336 476 void setBlurShadowMap(bool use){blurSM = use;} 477 /** 478 @see shadowMapMaterialName 479 */ 337 480 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 */ 339 487 void addPathMapClusters(String subEntityName, PathMapClusters clusters) 340 488 { 341 489 this->pathMapClusters[subEntityName] = clusters; 342 490 } 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 */ 343 497 PathMapClusters* getPathMapClusters(String subEntityName) 344 498 { 345 499 return &pathMapClusters[subEntityName]; 346 500 } 501 /** 502 @brief Adds a new PathMapEntryPoint cluster to the entrypoint list. 503 */ 347 504 void addPathMapEntryPoint(PathMapEntryPoint p) 348 505 { 349 506 this->pathMapEntryPoints.push_back(p); 350 507 } 508 /** 509 @brief Returns the list of entrypoints. 510 */ 351 511 std::vector<PathMapEntryPoint>& getPathMapEntryPoints() 352 512 { 353 513 return pathMapEntryPoints; 354 514 } 515 /** 516 @brief Adds a new cluster size. 517 */ 355 518 void addPathMapClusterLength(unsigned int l) 356 519 { 357 520 this->pathMapClusterLengths.push_back(l); 358 521 } 522 /** 523 @brief Gets the number of clusters. 524 */ 359 525 unsigned int getPathMapClusterLengthsSize() 360 526 { 361 527 return this->pathMapClusterLengths.size(); 362 528 } 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 */ 363 535 unsigned int getPathMapClusterLength(unsigned int index) 364 536 { 365 537 return pathMapClusterLengths.at(index); 366 538 } 539 /** 540 @see areaLightRadius 541 */ 367 542 float getAreaLightRadius(){return areaLightRadius;} 543 /** 544 @see areaLightRadius 545 */ 368 546 void setAreaLigtRadius(float radius){areaLightRadius = radius;} 369 547 };
Note: See TracChangeset
for help on using the changeset viewer.