Changeset 115 for trunk/VUT/work/ogre_changes/OgreMain
- Timestamp:
- 05/30/05 03:20:23 (19 years ago)
- Location:
- trunk/VUT/work/ogre_changes/OgreMain
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/OgreMain/include/OgreHardwareOcclusionQuery.h
r92 r115 96 96 * Pulls the hardware occlusion query too see if there is a result. 97 97 * @retval NumOfFragments will get the resulting number of fragments. 98 * @param waitForResult if true, the query will wait until a result is available99 * @return True if success or false if not.100 * @Remarks Hardware occlusion is an assyncronius process the result may take a frame or so.101 * one idea is to test pass1 and if not visible skip pass2. Also note that objects102 * not visible must be tested evrey frame. Visable objects don't need testing every frame.103 * Testing non visable objects can be don unlit, no texture with low LOD object.104 * 0 will generate all the levels till 1x1. [default: 0]105 */106 #ifdef GTP_VISIBILITY_MODIFIED_OGRE107 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ) = 0;108 #else109 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments ) = 0;110 #endif111 /**112 * Pulls the hardware occlusion query too see if there is a result.113 * @retval NumOfFragments will get the resulting number of fragments.114 * @param waitForResult if true, the query will wait until a result is available115 98 * @return True if success or false if not. 116 99 * @Remarks In DX9 mode specifying OCCLUSIONQUERY_FLUSH as the flag, will case the driver to flush whatever API calls are batched. 117 100 * In OpenGL mode it makes no difference if you specify OCCLUSIONQUERY_FLUSH or OCCLUSIONQUERY_NOFLUSH. 118 101 */ 119 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 120 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 121 const HW_OCCLUSIONQUERY flag ) = 0; 122 #else 123 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, 124 const HW_OCCLUSIONQUERY flag ) = 0; 125 #endif 102 virtual bool pullOcclusionQuery(unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH) = 0; 103 126 104 /** 127 105 * Let's you get the last pixel count with out doing the hardware occlusion test … … 143 121 virtual void setSkipRate( int skip ) = 0; 144 122 virtual int getSkipRate() = 0; 123 124 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 125 /** 126 Pulls occlusion query. 127 @param NumOfFragments number of visible fragments if query result was available. 128 Last query result if query result was not yet available. 129 130 @param waitForResult if true, the function waits until the result is available. 131 Otherwise the function returns immediately, not waiting for the result. 132 @returns true if query result was available, false if result was not yet available 133 */ 134 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 135 const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH ) = 0; 136 #endif // GTP_VISIBILITY_MODIFIED_OGRE 137 145 138 //---------------------------------------------------------------------- 146 139 // Private members -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h
r74 r115 128 128 @param node scene node to be rendered 129 129 @param cam current camera 130 @param leaveTransparentsInQueue if only solid objects should be rendered 130 131 */ 131 void _renderSceneNode( Camera *cam, SceneNode *node);132 /** deletes all queues which we were currently processing133 @remark clears render queueafter rendering scene node132 void _renderSceneNode(Camera *cam, SceneNode *node, bool leaveTransparentsInQueue = false); 133 /** deletes all processed queues 134 @remark clears render queues after rendering scene node 134 135 */ 135 void _deleteRenderedQueueGroups( );136 void _deleteRenderedQueueGroups(bool leaveTransparentsInQueue); 136 137 /** Internal method used by _renderVisibleObjects to deal with renderables 137 138 which override the camera's own view / projection materices. -
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp
r99 r115 59 59 #include "OgreDataStream.h" 60 60 #include "OgreStaticGeometry.h" 61 #include <windows.h> //matt: remove later 61 62 62 // This class implements the most basic scene manager 63 63 … … 665 665 if (lastUsedVertexProgram) 666 666 { 667 //matt: remove later668 //OutputDebugString("unbinding vertex program\n");669 670 667 mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM); 671 668 lastUsedVertexProgram = false; … … 990 987 const String& groupName) 991 988 { 992 mSkyPlaneEnabled = enable;993 989 if (enable) 994 990 { … … 1061 1057 1062 1058 } 1059 mSkyPlaneEnabled = enable; 1063 1060 } 1064 1061 //----------------------------------------------------------------------- … … 1071 1068 const String& groupName) 1072 1069 { 1073 mSkyBoxEnabled = enable;1074 1070 if (enable) 1075 1071 { … … 1143 1139 1144 1140 } 1145 1141 mSkyBoxEnabled = enable; 1146 1142 } 1147 1143 //----------------------------------------------------------------------- … … 1157 1153 const String& groupName) 1158 1154 { 1159 mSkyDomeEnabled = enable;1160 1155 if (enable) 1161 1156 { … … 1164 1159 { 1165 1160 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 1166 "Sky dome material '" + materialName + " not found.",1161 "Sky dome material '" + materialName + "' not found.", 1167 1162 "SceneManager::setSkyDome"); 1168 1163 } … … 1208 1203 1209 1204 } 1205 mSkyDomeEnabled = enable; 1210 1206 } 1211 1207 //----------------------------------------------------------------------- … … 2658 2654 { 2659 2655 Light* l = i->second; 2656 if (l->isVisible()) 2657 { 2660 2658 if (l->getType() == Light::LT_DIRECTIONAL) 2661 2659 { … … 2675 2673 2676 2674 } 2675 } 2677 2676 } 2678 2677 … … 4180 4179 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 4181 4180 //----------------------------------------------------------------------- 4182 void SceneManager::_renderSceneNode( Camera *cam, SceneNode *node)4181 void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, bool leaveTransparentsInQueue) 4183 4182 { 4184 4183 node->_findVisibleObjects(cam, getRenderQueue(), false, mDisplayNodes, false); … … 4186 4185 4187 4186 // delete all rendered objects from renderqueue 4188 _deleteRenderedQueueGroups( );4189 } 4190 //----------------------------------------------------------------------- 4191 void SceneManager::_deleteRenderedQueueGroups( )4187 _deleteRenderedQueueGroups(leaveTransparentsInQueue); 4188 } 4189 //----------------------------------------------------------------------- 4190 void SceneManager::_deleteRenderedQueueGroups(bool leaveTransparentsInQueue) 4192 4191 { 4193 4192 RenderQueue::QueueGroupIterator queueIt = getRenderQueue()->_getQueueGroupIterator(); … … 4200 4199 4201 4200 if (isRenderQueueToBeProcessed(qId)) 4201 { 4202 if (leaveTransparentsInQueue) 4203 { 4204 pGroup->clearSolids(); 4205 } 4206 else 4207 { 4202 4208 pGroup->clear(); 4209 } 4210 } 4203 4211 } 4204 4212
Note: See TracChangeset
for help on using the changeset viewer.