Changeset 921 for OGRE/trunk/ogre_changes
- Timestamp:
- 05/06/06 18:47:53 (19 years ago)
- Location:
- OGRE/trunk/ogre_changes/Ogre1.2
- Files:
-
- 22 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/include/OgreRenderTarget.h
r768 r921 267 267 virtual void writeContentsToFile(const String& filename) = 0; 268 268 269 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 270 virtual uchar *getBufferContents(int &dimx, int &dimy) = 0; 271 #endif // GTP_VISIBILITY_MODIFIED_OGRE 272 273 269 274 /** Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file. 270 275 @returns the name of the file used.*/ … … 308 313 */ 309 314 virtual Impl *_getImpl(); 310 311 312 313 315 protected: 314 316 /// The name of this target. … … 356 358 /// internal method for firing events 357 359 virtual void fireViewportRemoved(Viewport* vp); 358 359 #ifdef GAMETOOLS_ILLUMINATION_MODULE360 public:361 unsigned long getLastFrameNumber(){return lastFrame;}362 protected:363 unsigned long lastFrame;364 #endif365 366 360 }; 367 361 -
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/include/OgreRenderable.h
r768 r921 53 53 { 54 54 public: 55 Renderable() : mPolygonModeOverrideable(true) 56 { 57 #ifdef GAMETOOLS_ILLUMINATION_MODULE 58 this->mRenderTechniqueGroup = 0; 59 #endif 60 } 55 Renderable() : mPolygonModeOverrideable(true) 56 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 57 , mId(-1) 58 #endif // GTP_VISIBILITY_MODIFIED_OGRE 59 {} 60 61 61 /** Virtual destructor needed as class has virtual methods. */ 62 62 virtual ~Renderable() { } … … 247 247 } 248 248 249 250 249 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 250 /** Sets an id for this renderable. 251 */ 252 void setId(int id) {mId = id;} 253 /** see set 254 */ 255 int getId() {return mId;} 256 #endif // GTP_VISIBILITY_MODIFIED_OGRE 251 257 protected: 252 258 static const PlaneList msDummyPlaneList; … … 254 260 CustomParameterMap mCustomParameters; 255 261 bool mPolygonModeOverrideable; 256 257 #ifdef GAMETOOLS_ILLUMINATION_MODULE 258 public: 259 260 virtual void setRenderTechniqueGroup(UserDefinedObject* renderTechniqueGroup) 261 { 262 this->mRenderTechniqueGroup = renderTechniqueGroup; 263 } 264 265 virtual UserDefinedObject* getRenderTechniqueGroup(void) const 266 { 267 return this->mRenderTechniqueGroup; 268 } 269 270 virtual void setMaterialName(const String &name){} 271 272 protected: 273 274 UserDefinedObject* mRenderTechniqueGroup; 275 #endif 276 262 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 263 int mId; 264 #endif // GTP_VISIBILITY_MODIFIED_OGRE 277 265 }; 278 266 -
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/include/OgreSceneManager.h
r768 r921 196 196 }; 197 197 198 typedefstruct SkyDomeGenParameters198 struct SkyDomeGenParameters 199 199 { 200 200 Real skyDomeCurvature; … … 205 205 int skyDomeYSegments_keep; 206 206 }; 207 207 208 208 struct SkyPlaneGenParameters 209 209 { … … 214 214 int skyPlaneYSegments; 215 215 }; 216 216 217 217 struct SkyBoxGenParameters 218 218 { 219 219 Real skyBoxDistance; 220 220 }; 221 222 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 223 /** added by matt: Render content of current scene node. 224 @param node scene node to be rendered 225 @param cam current camera 226 @param leavePassesInQueue list of passes which are left in queue 227 */ 228 void _renderSceneNode(Camera *cam, SceneNode *node, const int leavePassesInQueue = 0); 229 /** deletes all processed queues 230 @param leavePassesInQueue pass list which is not deleted from queue 231 @remark used to clear render queues before rendering scene node 232 */ 233 void _deleteRenderedQueueGroups(int leavePassesInQueue = 0); 234 /** Wrapper for useRenderableViewProjMde with is an 235 Internal method used by _renderVisibleObjects to deal with renderables 236 which override the camera's own view / projection materices. 237 */ 238 void useRenderableViewProjModeWrapper(Renderable* pRend); // HACK 239 /** HACK: A public wrapper method for setting up the renderstate for a rendering pass. 240 @param 241 pass The Pass details to set. 242 @returns 243 A Pass object that was used instead of the one passed in, can 244 happen when rendering shadow passes 245 @remark made public by matt 246 */ 247 virtual const Pass* setPassWrapper(Pass* pass); 248 249 /** Renders an Ogre Entity. 250 */ 251 //void renderEntity(Entity *ent); 252 253 /** Renders an Ogre MovableObject. 254 @param mov the movable object to be rendered 255 @param leavePassesInQueue flag determining the passes which are left 256 in render queue after rendering 257 */ 258 void _renderMovableObject(MovableObject *mov, const int leavePassesInQueue); 259 260 /** Renders a single renderable using pass 0 of the renderable. 261 */ 262 void _renderSingleRenderable(Renderable *rend); 263 264 /** Tells the scene manager that the frame ends (i.e., 265 one frame in the main loop. 266 */ 267 virtual void endFrame() {}; 268 269 #endif // GTP_VISIBILITY_MODIFIED_OGRE 270 221 271 protected: 222 272 /// Instance name … … 273 323 SceneNode* mSkyBoxNode; 274 324 325 // Sky plane 275 326 bool mSkyPlaneEnabled; 276 327 bool mSkyPlaneDrawFirst; 277 328 Plane mSkyPlane; 278 SceneManager::SkyPlaneGenParametersmSkyPlaneGenParameters;279 329 SkyPlaneGenParameters mSkyPlaneGenParameters; 330 // Sky box 280 331 bool mSkyBoxEnabled; 281 332 bool mSkyBoxDrawFirst; 282 333 Quaternion mSkyBoxOrientation; 283 SceneManager::SkyBoxGenParametersmSkyBoxGenParameters;284 334 SkyBoxGenParameters mSkyBoxGenParameters; 335 // Sky dome 285 336 bool mSkyDomeEnabled; 286 337 bool mSkyDomeDrawFirst; 287 338 Quaternion mSkyDomeOrientation; 288 SceneManager::SkyDomeGenParameters mSkyDomeGenParameters;289 290 339 SkyDomeGenParameters mSkyDomeGenParameters; 340 341 // Fog 291 342 FogMode mFogMode; 292 343 ColourValue mFogColour; … … 1297 1348 1298 1349 /** Get the sky plane node, if enabled. */ 1299 virtual SceneNode* getSkyPlaneNode(void) { return mSkyPlaneNode; } 1350 virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; } 1351 1300 1352 /** Get the parameters used to construct the SkyPlane, if any **/ 1301 virtual SceneManager::SkyPlaneGenParametersgetSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }1353 virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; } 1302 1354 1303 1355 /** Enables / disables a 'sky box' i.e. a 6-sided box at constant … … 1352 1404 /** Get the skybox node, if enabled. */ 1353 1405 virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; } 1354 1355 /** Get the parameters used to generate the current S KyBox, if any */1356 virtual SceneManager::SkyBoxGenParametersgetSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }1357 1406 1407 /** Get the parameters used to generate the current SkyBox, if any */ 1408 virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; } 1409 1358 1410 /** Enables / disables a 'sky dome' i.e. an illusion of a curved sky. 1359 1411 @remarks … … 1422 1474 1423 1475 /** Get the sky dome node, if enabled. */ 1424 virtual SceneNode* getSkyDomeNode(void) { return mSkyDomeNode; }1425 1476 virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; } 1477 1426 1478 /** Get the parameters used to generate the current SkyDome, if any */ 1427 virtual SceneManager::SkyDomeGenParameters getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; } 1479 virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; } 1480 1428 1481 /** Sets the fogging mode applied to the scene. 1429 1482 @remarks … … 2326 2379 */ 2327 2380 RenderSystem *getDestinationRenderSystem(); 2328 2329 #ifdef GAMETOOLS_ILLUMINATION_MODULE2330 public:2331 void prepareRenderQueue_Wrap(){this->prepareRenderQueue();}2332 #endif2333 2334 2381 }; 2335 2382 -
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/src/OgreSceneManager.cpp
r768 r921 1046 1046 1047 1047 // Prepare render queue for receiving new objects 1048 #ifdef GAMETOOLS_ILLUMINATION_MODULE 1049 if (mFindVisibleObjects) 1050 prepareRenderQueue(); 1051 #else 1052 prepareRenderQueue(); 1053 #endif 1054 1048 prepareRenderQueue(); 1055 1049 1056 1050 if (mFindVisibleObjects) … … 1304 1298 } 1305 1299 // Set active frame 1306 boxMat->getBestTechnique()->getPass(0)->getTextureUnitState(0) 1307 ->setCurrentFrame(i); 1300 Material::TechniqueIterator ti = boxMat->getSupportedTechniqueIterator(); 1301 while (ti.hasMoreElements()) 1302 { 1303 Technique* tech = ti.getNext(); 1304 tech->getPass(0)->getTextureUnitState(0)->setCurrentFrame(i); 1305 } 1308 1306 1309 1307 mSkyBoxEntity[i]->setMaterialName(boxMat->getName()); … … 2207 2205 return false; 2208 2206 } 2209 2210 #ifdef GAMETOOLS_ILLUMINATION_MODULE2211 if(!pass->isActive())2212 return false;2213 #endif2214 2207 2215 2208 return true; … … 4166 4159 mShadowIndexBuffer = HardwareBufferManager::getSingleton(). 4167 4160 createIndexBuffer(HardwareIndexBuffer::IT_16BIT, 4168 mShadowIndexBufferSize,4161 size, 4169 4162 HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 4170 4163 false); … … 4859 4852 } 4860 4853 4861 } 4854 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 4855 //----------------------------------------------------------------------- 4856 const Pass* SceneManager::setPassWrapper(Pass* pass) 4857 { 4858 return _setPass(pass); 4859 } 4860 //----------------------------------------------------------------------- 4861 void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, const int leavePassesInQueue) 4862 { 4863 // delete previously rendered objects from renderqueue 4864 _deleteRenderedQueueGroups(leavePassesInQueue); 4865 4866 node->_findVisibleObjects(cam, getRenderQueue(), false, mDisplayNodes, false); 4867 SceneManager::_renderVisibleObjects(); 4868 } 4869 //----------------------------------------------------------------------- 4870 void SceneManager::_deleteRenderedQueueGroups(const int leavePassesInQueue) 4871 { 4872 RenderQueue::QueueGroupIterator queueIt = 4873 getRenderQueue()->_getQueueGroupIterator(); 4874 4875 //-- find currently processed queue groups and delelete them from render queue 4876 while (queueIt.hasMoreElements()) 4877 { 4878 RenderQueueGroupID qId = static_cast<RenderQueueGroupID>(queueIt.peekNextKey()); 4879 RenderQueueGroup* pGroup = queueIt.getNext(); 4880 4881 if (isRenderQueueToBeProcessed(qId)) 4882 { 4883 pGroup->clear(leavePassesInQueue); 4884 } 4885 } 4886 4887 // Now trigger the pending pass updates 4888 // Pass::processPendingPassUpdates(); 4889 } 4890 4891 //----------------------------------------------------------------------- 4892 /*void SceneManager::renderEntity(Entity *ent) 4893 { 4894 int n = (int)ent->getNumSubEntities(); 4895 4896 for (int i = 0; i < n; ++i) 4897 { 4898 Pass *pass = setPass(ent->getSubEntity(i)->getTechnique()->getPass(0)); 4899 4900 _renderSingleObject(ent->getSubEntity(i), pass, false); 4901 } 4902 }*/ 4903 //----------------------------------------------------------------------- 4904 void SceneManager::_renderMovableObject(MovableObject *mov, const int leavePassesInQueue) 4905 { 4906 // delete previously rendered objects from renderqueue 4907 _deleteRenderedQueueGroups(leavePassesInQueue); 4908 4909 mov->_updateRenderQueue(getRenderQueue()); 4910 SceneManager::_renderVisibleObjects(); 4911 } 4912 //----------------------------------------------------------------------- 4913 void SceneManager::_renderSingleRenderable(Renderable *rend) 4914 { 4915 Pass *pass = rend->getTechnique()->getPass(0); 4916 _setPass(pass); 4917 renderSingleObject(rend, pass, false); 4918 } 4919 //----------------------------------------------------------------------- 4920 void SceneManager::useRenderableViewProjModeWrapper(Renderable* pRend) 4921 { 4922 useRenderableViewProjMode(pRend); 4923 } 4924 #endif //GTP_VISIBILITY_MODIFIED_OGRE 4925 4926 }
Note: See TracChangeset
for help on using the changeset viewer.