Ignore:
Timestamp:
08/03/05 14:12:41 (19 years ago)
Author:
mattausch
Message:

changed to ogre 103
added readme

Location:
trunk/VUT/work/ogre_changes/OgreMain
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderQueueSortingGrouping.h

    r139 r193  
    4848        objects. 
    4949    */ 
    50     class RenderPriorityGroup 
     50#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     51        class _OgreExport RenderPriorityGroup 
     52#else 
     53    class _OgrePrivate RenderPriorityGroup 
     54#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    5155    { 
    5256        /** Internal struct reflecting a single Pass for a Renderable.  
     
    247251        This is an internal OGRE class, not intended for apps to use. 
    248252    */ 
    249     class RenderQueueGroup 
     253    class _OgrePrivate RenderQueueGroup 
    250254    { 
    251255    public: 
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderSystem.h

    r150 r193  
    318318                                Values: true, false 
    319319                                Default: 0 
     320                                **  
     321                                Key: "border"  
     322                                Description: The type of window border (in windowed mode) 
     323                                Values: none, fixed, resize 
     324                                Default: resize 
     325                                ** 
     326                                Key: "outerDimensions"  
     327                                Description: Whether the width/height is expressed as the size of the  
     328                                outer window, rather than the content area 
     329                                Values: true, false 
     330                                Default: false  
    320331        */ 
    321332                virtual RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height,  
     
    980991        bool mInvertVertexWinding; 
    981992 
     993#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    982994                int mColour[4]; 
     995#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    983996    }; 
    984997} 
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderable.h

    r158 r193  
    5353    { 
    5454    public: 
    55                 Renderable() {mId = -1;} 
     55                Renderable() : mRenderDetailOverrideable(true)  
     56#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     57, mId(-1) 
     58#endif // GTP_VISIBILITY_MODIFIED_OGRE 
     59{} 
     60                 
    5661        /** Virtual destructor needed as class has virtual methods. */ 
    5762        virtual ~Renderable() { } 
     
    227232            } 
    228233        } 
     234 
     235                /** Sets whether this renderable's chosen detail level can be 
     236                        overridden (downgraded) by the camera setting.  
     237                @param override true means that a lower camera detail will override this 
     238                        renderables detail level, false means it won't. 
     239                */ 
     240                virtual void setRenderDetailOverrideable(bool override) 
     241                { 
     242                        mRenderDetailOverrideable = override; 
     243                } 
     244 
     245                /** Gets whether this renderable's chosen detail level can be 
     246                        overridden (downgraded) by the camera setting.  
     247                */ 
     248                virtual bool getRenderDetailOverrideable(void) const 
     249                { 
     250                        return mRenderDetailOverrideable; 
     251                } 
     252 
     253#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    229254                /** Sets an id for this renderable. 
    230255                */ 
     
    233258                */ 
    234259                int getId() {return mId;} 
    235  
     260#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    236261    protected: 
    237262        static const PlaneList msDummyPlaneList; 
    238263        typedef std::map<size_t, Vector4> CustomParameterMap; 
    239264        CustomParameterMap mCustomParameters; 
     265                bool mRenderDetailOverrideable; 
     266#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    240267                int mId; 
     268#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    241269    }; 
    242270 
  • trunk/VUT/work/ogre_changes/OgreMain/src/OgreFrustum.cpp

    r61 r193  
    496496            updateFrustum(); 
    497497 
     498                        Vector3 newpos = position; 
     499                        if (mReflect) 
     500                        { 
     501                                newpos = mReflectMatrix * newpos; 
     502                        } 
    498503            Matrix4 combo = mStandardProjMatrix * mViewMatrix; 
    499504            mFrustumPlanes[FRUSTUM_PLANE_LEFT].normal.x = combo[3][0] + combo[0][0]; 
     
    520525            mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.y = combo[3][1] + combo[2][1]; 
    521526            mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.z = combo[3][2] + combo[2][2]; 
    522             mFrustumPlanes[FRUSTUM_PLANE_NEAR].d = combo[3][3] + combo[2][3]; 
     527                        mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.normalise(); 
     528                        mFrustumPlanes[FRUSTUM_PLANE_NEAR].d =  
     529                                -(mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.dotProduct(newpos) + mNearDist); 
    523530 
    524531            mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.x = combo[3][0] - combo[2][0]; 
    525532            mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.y = combo[3][1] - combo[2][1]; 
    526533            mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.z = combo[3][2] - combo[2][2]; 
    527             mFrustumPlanes[FRUSTUM_PLANE_FAR].d = combo[3][3] - combo[2][3]; 
    528  
    529             // Renormalise any normals which were not unit length 
    530             for(int i=0; i<6; i++ )  
     534                        mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.normalise(); 
     535                        mFrustumPlanes[FRUSTUM_PLANE_FAR].d =  
     536                                -(mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.dotProduct(newpos) - mFarDist); 
     537 
     538            // Renormalise any normals which were not unit length (not near & far) 
     539            for(int i=2; i<6; i++ )  
    531540            { 
    532541                float length = mFrustumPlanes[i].normal.normalise(); 
  • trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp

    r183 r193  
    130130        mShadowCasterQueryListener = new ShadowCasterSceneQueryListener(this); 
    131131 
    132  
     132    Root *root = Root::getSingletonPtr(); 
     133    if (root) 
     134        _setDestinationRenderSystem(root->getRenderSystem()); 
    133135} 
    134136//----------------------------------------------------------------------- 
     
    392394                // Calc squared distance 
    393395                lt->tempSquareDist = (lt->getDerivedPosition() - position).squaredLength(); 
    394                 lt->tempSquareDist -= squaredRadius; 
    395396                // only add in-range lights 
    396397                Real range = lt->getAttenuationRange(); 
    397                 if (lt->tempSquareDist <= (range * range)) 
     398                if ((lt->tempSquareDist - squaredRadius) <= (range * range)) 
    398399                { 
    399400                    destList.push_back(lt); 
     
    403404    } 
    404405 
    405     // Sort 
    406     std::sort(destList.begin(), destList.end(), lightLess()); 
     406    // Sort (stable to guarantee ordering on directional lights) 
     407    std::stable_sort(destList.begin(), destList.end(), lightLess()); 
    407408 
    408409 
     
    527528{ 
    528529        removeAllStaticGeometry(); 
     530    removeAllEntities(); 
     531    removeAllBillboardSets(); 
     532    removeAllLights(); 
     533 
     534        // Clear root node of all children 
     535        mSceneRoot->removeAllChildren(); 
     536        mSceneRoot->detachAllObjects(); 
     537 
    529538    // Delete all SceneNodes, except root that is 
    530539    for (SceneNodeList::iterator i = mSceneNodes.begin(); 
     
    536545    mAutoTrackingSceneNodes.clear(); 
    537546 
    538     // Clear root node of all children 
    539     mSceneRoot->removeAllChildren(); 
    540     mSceneRoot->detachAllObjects(); 
    541  
    542     removeAllEntities(); 
    543     removeAllBillboardSets(); 
    544     removeAllLights(); 
     547 
    545548 
    546549    // Clear animations 
     
    607610    } 
    608611 
     612        // detach from parent (don't do this in destructor since bulk destruction 
     613        // behaves differently) 
     614        Node* parentNode = i->second->getParent(); 
     615        if (parentNode) 
     616        { 
     617                parentNode->removeChild(i->second); 
     618        } 
    609619    delete i->second; 
    610620    mSceneNodes.erase(i); 
     
    646656 
    647657    // TEST 
    648      
    649     //LogManager::getSingleton().logMessage("BEGIN PASS " + StringConverter::toString(pass->getIndex()) +  
    650     //" of " + pass->getParent()->getParent()->getName() + "\n"); 
    651      
     658    /* 
     659    LogManager::getSingleton().logMessage("BEGIN PASS " + StringConverter::toString(pass->getIndex()) +  
     660    " of " + pass->getParent()->getParent()->getName()); 
     661    */ 
    652662    bool passSurfaceAndLightParams = true; 
    653663 
     
    868878    // Tell params about current ambient light 
    869879    mAutoParamDataSource.setAmbientLightColour(mAmbientLight); 
     880        // Tell rendersystem 
     881        mDestRenderSystem->setAmbientLight(mAmbientLight.r, mAmbientLight.g, mAmbientLight.b); 
    870882 
    871883    // Tell params about render target 
     
    15401552            renderShadowVolumesToStencil(l, mCameraInProgress); 
    15411553            // render full-screen shadow modulator for all lights 
    1542                         //LogManager::getSingleton().logMessage("setting shadow modulative pass"); 
    15431554            setPass(mShadowModulativePass); 
    15441555            // turn stencil check on 
     
    18011812            continue; 
    18021813 
    1803                 //LogManager::getSingleton().logMessage("setting solid pass"); 
    18041814        // For solids, we try to do each pass in turn 
    18051815        Pass* usedPass = setPass(ipass->first); 
     
    18321842        itrans != itransend; ++itrans) 
    18331843    { 
    1834                 //LogManager::getSingleton().logMessage("setting transparent pass"); 
    18351844        // For transparents, we have to accept that we can't sort entirely by pass 
    18361845        setPass(itrans->pass); 
     
    19091918 
    19101919        itransend = objs.end(); 
    1911         for (itrans = objs.begin(); itrans != itransend; ++itrans) 
     1920        for (itrans = objs.begin();  
     1921                itrans != itransend; ++itrans) 
    19121922        { 
    19131923                Renderable *r = itrans->renderable; 
     
    19171927                if (p->getParent()->getParent()->getTransparencyCastsShadows()) 
    19181928                { 
    1919                         //LogManager::getSingleton().logMessage("setting transparent shadow pass"); 
    19201929                        setPass(p); 
    19211930                        renderSingleObject(itrans->renderable, p, doLightIteration, manualLightList); 
     
    19301939    unsigned short numMatrices; 
    19311940    static bool normalisedNormals = false; 
    1932     static SceneDetailLevel camDetailLevel = mCameraInProgress->getDetailLevel(); 
     1941    SceneDetailLevel camDetailLevel = mCameraInProgress->getDetailLevel(); 
    19331942    static SceneDetailLevel lastDetailLevel = camDetailLevel; 
    19341943    static RenderOperation ro; 
     
    19811990    // Set up the solid / wireframe override 
    19821991    SceneDetailLevel reqDetail = rend->getRenderDetail(); 
    1983     if (reqDetail != lastDetailLevel || reqDetail != camDetailLevel) 
    1984     { 
     1992    if (rend->getRenderDetailOverrideable()) 
     1993    { 
     1994        // check camera detial only when render detail is overridable 
    19851995        if (reqDetail > camDetailLevel) 
    19861996        { 
     
    19881998            reqDetail = camDetailLevel; 
    19891999        } 
     2000    } 
     2001    if (reqDetail != lastDetailLevel) 
     2002    { 
    19902003        mDestRenderSystem->_setRasterisationMode(reqDetail); 
    19912004        lastDetailLevel = reqDetail; 
     
    24162429        mDestRenderSystem->_beginFrame(); 
    24172430 
    2418         //LogManager::getSingleton().logMessage("setting manual pass"); 
    24192431    setPass(pass); 
    24202432    mDestRenderSystem->_render(*rend); 
     
    28142826void SceneManager::initShadowVolumeMaterials(void) 
    28152827{ 
     2828    /* This should have been set in the SceneManager constructor, but if you 
     2829       created the SceneManager BEFORE the Root object, you will need to call 
     2830       SceneManager::_setDestinationRenderSystem manually. 
     2831     */ 
     2832    assert( mDestRenderSystem ); 
    28162833 
    28172834    if (mShadowMaterialInitDone) 
     
    30123029Pass* SceneManager::deriveShadowCasterPass(Pass* pass) 
    30133030{ 
    3014         //LogManager::getSingleton().logMessage("*********derive shadow caster pass*********"); 
    30153031    switch (mShadowTechnique) 
    30163032    { 
     
    30183034                if (mShadowTextureCustomCasterPass) 
    30193035                { 
    3020                         //LogManager::getSingleton().logMessage("custom caster pass"); 
    30213036                        // Caster pass has been customised 
    30223037 
    30233038                        if (!pass->getShadowCasterVertexProgramName().empty()) 
    30243039                        { 
    3025                                 //LogManager::getSingleton().logMessage("custom caster pass has vertex program"); 
    30263040                                // Have to merge the shadow caster vertex program in 
    30273041                                mShadowTextureCustomCasterPass->setVertexProgram( 
     
    30403054                        else if (mShadowTextureCasterVPDirty) 
    30413055                        { 
    3042                                 //LogManager::getSingleton().logMessage("caster pass dirty"); 
    30433056                                // reset 
    30443057                                mShadowTextureCustomCasterPass->setVertexProgram( 
     
    30563069                else 
    30573070                { 
    3058                         //LogManager::getSingleton().logMessage("standard caster pass"); 
    30593071                        // Standard pass 
    30603072                        if (pass->hasVertexProgram()) 
    30613073                        { 
    3062                                 //LogManager::getSingleton().logMessage("standard caster pass has vertex program"); 
    30633074                                // Have to merge the shadow caster vertex program in 
    30643075                                // This may in fact be blank, in which case it falls back on  
     
    30813092                        else if (mShadowCasterPlainBlackPass->hasVertexProgram()) 
    30823093                        { 
    3083                                 //LogManager::getSingleton().logMessage("standard caster pass no vertex program"); 
    30843094                                // reset 
    30853095                                mShadowCasterPlainBlackPass->setVertexProgram(""); 
     
    30953105Pass* SceneManager::deriveShadowReceiverPass(Pass* pass) 
    30963106{ 
    3097         //LogManager::getSingleton().logMessage("*********derive shadow receiver pass*********"); 
     3107 
    30983108    switch (mShadowTechnique) 
    30993109    { 
     
    31023112                { 
    31033113                        // Receiver pass has been customised 
    3104                         //LogManager::getSingleton().logMessage("custom receiver pass"); 
     3114 
    31053115                        if (!pass->getShadowReceiverVertexProgramName().empty()) 
    31063116                        { 
    3107                                 //LogManager::getSingleton().logMessage("merge receiver pass shadow vertex program"); 
    31083117                                // Have to merge the shadow Receiver vertex program in 
    31093118                                mShadowTextureCustomReceiverPass->setVertexProgram( 
     
    31223131                        else if (mShadowTextureReceiverVPDirty) 
    31233132                        { 
    3124                                 //LogManager::getSingleton().logMessage("receiver pass dirty"); 
    31253133                                // reset 
    31263134                                mShadowTextureCustomReceiverPass->setVertexProgram( 
     
    31383146                else 
    31393147                { 
    3140                         //LogManager::getSingleton().logMessage("no custom receiver pass"); 
    31413148                        if (pass->hasVertexProgram()) 
    31423149                        { 
    3143                                 //LogManager::getSingleton().logMessage("standard receiver pass has vertex program"); 
    31443150                                // Have to merge the receiver vertex program in 
    31453151                                // This may return "" which means fixed function will be used 
     
    31613167                        else if (mShadowReceiverPass->hasVertexProgram()) 
    31623168                        { 
    3163                                 //LogManager::getSingleton().logMessage("standard receiver pass no vertex program"); 
    31643169                                // reset 
    31653170                                mShadowReceiverPass->setVertexProgram(""); 
     
    33833388                setColourOperationEx(LBX_MODULATE, LBS_MANUAL, LBS_CURRENT, 
    33843389                zfailAlgo ? ColourValue(0.7, 0.0, 0.2) : ColourValue(0.0, 0.7, 0.2)); 
    3385                         //LogManager::getSingleton().logMessage("setting shadow debug pass"); 
    33863390            setPass(mShadowDebugPass); 
    33873391            renderShadowVolumeObjects(iShadowRenderables, mShadowDebugPass, &lightList, flags, 
Note: See TracChangeset for help on using the changeset viewer.