Revision: 1639
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1639&view=rev
Author:   rorthomas
Date:     2011-02-03 01:18:50 +0000 (Thu, 03 Feb 2011)

Log Message:
-----------
excluded particle systems from depth map -> no more distortion in DOF

Modified Paths:
--------------
    trunk/source/main/BeamLoadTruck.cpp
    trunk/source/main/DustPool.cpp
    trunk/source/main/RigsOfRods.cpp
    trunk/source/main/RoRPrerequisites.h
    trunk/source/main/dof/DepthOfFieldEffect.cpp
    trunk/source/main/turbojet.cpp
    trunk/source/main/turboprop.cpp

Modified: trunk/source/main/BeamLoadTruck.cpp
===================================================================
--- trunk/source/main/BeamLoadTruck.cpp 2011-02-02 21:28:28 UTC (rev 1638)
+++ trunk/source/main/BeamLoadTruck.cpp 2011-02-03 01:18:50 UTC (rev 1639)
@@ -842,9 +842,9 @@
                                                        sprintf(wname, 
"exhaust-%d-%s", (int)exhausts.size(), truckname);
                                                        //if (pSysM) 
smoker=pSysM->createSystem(wname, "tracks/Smoke");
                                                        
e.smoker=manager->createParticleSystem(wname, "tracks/Smoke");
+                                                       if (!e.smoker) continue;
+                                                       
e.smoker->setVisibilityFlags(DEPTHMAP_DISABLED); // disable particles in 
depthmap
                                                        // ParticleSystem* pSys 
= ParticleSystemManager::getSingleton().createSystem("exhaust", "tracks/Smoke");
-                                                       if (!e.smoker)
-                                                               continue;
                                                        
e.smokeNode->attachObject(e.smoker);
                                                        
e.smokeNode->setPosition(nodes[e.emitterNode].AbsPosition);
                                                        exhausts.push_back(e);
@@ -870,9 +870,9 @@
                                                        sprintf(wname, 
"exhaust-%d-%s", (int)exhausts.size(), truckname);
                                                        //if (pSysM) 
smoker=pSysM->createSystem(wname, "tracks/Smoke");
                                                        
e.smoker=manager->createParticleSystem(wname, "tracks/Smoke");
+                                                       if (!e.smoker)  
continue;
+                                                       
e.smoker->setVisibilityFlags(DEPTHMAP_DISABLED); // disable particles in 
depthmap
                                                        // ParticleSystem* pSys 
= ParticleSystemManager::getSingleton().createSystem("exhaust", "tracks/Smoke");
-                                                       if (!e.smoker)
-                                                               continue;
                                                        
e.smokeNode->attachObject(e.smoker);
                                                        
e.smokeNode->setPosition(nodes[e.emitterNode].AbsPosition);
                                                        exhausts.push_back(e);
@@ -2958,8 +2958,8 @@
                        if(usedSkin) strncpy(material, 
usedSkin->getReplacementForMaterial(material).c_str(), 50);
 
                        e.smoker = manager->createParticleSystem(wname, 
material);
-                       if (!e.smoker)
-                               continue;
+                       if (!e.smoker) continue;
+                       e.smoker->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                        e.smokeNode->attachObject(e.smoker);
                        
e.smokeNode->setPosition(nodes[e.emitterNode].AbsPosition);
                        nodes[id1].isHot=true;
@@ -3000,8 +3000,8 @@
                        char wname[256];
                        sprintf(wname, "cparticle-%i-%s", free_cparticle, 
truckname);
                        cparticles[free_cparticle].psys = 
manager->createParticleSystem(wname, psystem);
-                       if (!cparticles[free_cparticle].psys)
-                               continue;
+                       if (!cparticles[free_cparticle].psys) continue;
+                       
cparticles[free_cparticle].psys->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                        
cparticles[free_cparticle].snode->attachObject(cparticles[free_cparticle].psys);
                        
cparticles[free_cparticle].snode->setPosition(nodes[cparticles[free_cparticle].emitterNode].AbsPosition);
                        //shut down the emitters

Modified: trunk/source/main/DustPool.cpp
===================================================================
--- trunk/source/main/DustPool.cpp      2011-02-02 21:28:28 UTC (rev 1638)
+++ trunk/source/main/DustPool.cpp      2011-02-03 01:18:50 UTC (rev 1639)
@@ -19,6 +19,7 @@
 */
 #include "DustPool.h"
 #include "water.h"
+#include "RoRPrerequisites.h"
 
 DustPool::DustPool(char* dname, int dsize, SceneNode *parent, SceneManager 
*smgr, Water *mw)
 {
@@ -36,6 +37,8 @@
                {
                        sns[i]->attachObject(pss[i]);
                        pss[i]->setCastShadows(false);
+                       pss[i]->setVisibilityFlags(DEPTHMAP_DISABLED);
+
                        //can't do this
 //                             if (w) 
((DeflectorPlaneAffector*)(pss[i]->getAffector(0)))->setPlanePoint(Vector3(0, 
w->getHeight(), 0));
                }

Modified: trunk/source/main/RigsOfRods.cpp
===================================================================
--- trunk/source/main/RigsOfRods.cpp    2011-02-02 21:28:28 UTC (rev 1638)
+++ trunk/source/main/RigsOfRods.cpp    2011-02-03 01:18:50 UTC (rev 1639)
@@ -164,6 +164,10 @@
                LogManager::getSingleton().setLogDetail(LL_LOW);
        //FROM NOW ON WE HAVE LOGMANAGER!
 
+       // by default, display everything in the depth map
+       Ogre::MovableObject::setDefaultVisibilityFlags(DEPTHMAP_ENABLED);
+
+
        CACHE.setLocation(SETTINGS.getSetting("Cache Path"), 
SETTINGS.getSetting("Config Root"));
 
        ColoredTextAreaOverlayElementFactory *cef = new 
ColoredTextAreaOverlayElementFactory();

Modified: trunk/source/main/RoRPrerequisites.h
===================================================================
--- trunk/source/main/RoRPrerequisites.h        2011-02-02 21:28:28 UTC (rev 
1638)
+++ trunk/source/main/RoRPrerequisites.h        2011-02-03 01:18:50 UTC (rev 
1639)
@@ -129,5 +129,9 @@
 FWDCLSTRUCT(client);
 FWDCLSTRUCT(authorinfo);
 
+enum VisibilityMasks {
+       DEPTHMAP_ENABLED  = 1,
+       DEPTHMAP_DISABLED = 2,
+};
 
 #endif //RORPREREQUISITES_H__

Modified: trunk/source/main/dof/DepthOfFieldEffect.cpp
===================================================================
--- trunk/source/main/dof/DepthOfFieldEffect.cpp        2011-02-02 21:28:28 UTC 
(rev 1638)
+++ trunk/source/main/dof/DepthOfFieldEffect.cpp        2011-02-03 01:18:50 UTC 
(rev 1639)
@@ -7,6 +7,10 @@
 #include <Ogre.h>
 #include "Lens.h"
 
+#include "RoRPrerequisites.h"
+
+#include "Settings.h"
+
 using namespace Ogre;
 
 const int DepthOfFieldEffect::BLUR_DIVISOR = 2;
@@ -95,7 +99,11 @@
        */
 
        mDepthViewport->setShadowsEnabled(false);
+       mDepthViewport->setOverlaysEnabled(false);
+       mDepthViewport->setSkiesEnabled(false);
 
+       mDepthViewport->setVisibilityMask(~DEPTHMAP_DISABLED);
+
        //re-set texture "DoF_Depth"
        MaterialPtr p = 
MaterialManager::getSingleton().getByName("DoF_DepthOfField");
        p->load();
@@ -188,6 +196,8 @@
        
if((!fragParams.isNull())&&(fragParams->_findNamedConstantDefinition("dofParams")))
                fragParams->setNamedConstant("dofParams", dofParams,1,4);       
        
 
+       evt.source->setVisibilityMask(~DEPTHMAP_DISABLED);
+
        // Add 'this' as a RenderableListener to replace the technique for all 
renderables
        RenderQueue* queue = 
evt.source->getCamera()->getSceneManager()->getRenderQueue();
        queue->setRenderableListener(this);
@@ -228,7 +238,7 @@
        //mRaySceneQuery->setQueryMask(queryMask);
 
        debugNode = 0;
-       bool debug = false;
+       bool debug = (SETTINGS.getSetting("DOFDebug") == "Yes");
        if(debug)
        {
                MaterialPtr material = 
MaterialManager::getSingleton().getByName("DoF_DepthDebug");

Modified: trunk/source/main/turbojet.cpp
===================================================================
--- trunk/source/main/turbojet.cpp      2011-02-02 21:28:28 UTC (rev 1638)
+++ trunk/source/main/turbojet.cpp      2011-02-03 01:18:50 UTC (rev 1639)
@@ -94,6 +94,7 @@
                smokePS=manager->createParticleSystem(paname, 
"tracks/TurbopropSmoke");
                if (smokePS) 
                {
+                       smokePS->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                        smokeNode->attachObject(smokePS);
                        smokePS->setCastShadows(false);
                }
@@ -105,6 +106,7 @@
                        heathazePS=manager->createParticleSystem(paname, 
"tracks/JetHeatHaze");
                        smokeNode->attachObject(heathazePS);
                        heathazePS->setCastShadows(false);
+                       heathazePS->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                }
        }
 }

Modified: trunk/source/main/turboprop.cpp
===================================================================
--- trunk/source/main/turboprop.cpp     2011-02-02 21:28:28 UTC (rev 1638)
+++ trunk/source/main/turboprop.cpp     2011-02-03 01:18:50 UTC (rev 1639)
@@ -106,6 +106,7 @@
                smokePS=manager->createParticleSystem(dename, 
"tracks/TurbopropSmoke");
                if (smokePS) 
                {
+                       smokePS->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                        smokeNode->attachObject(smokePS);
                        smokePS->setCastShadows(false);
                }
@@ -117,6 +118,7 @@
                        heathazePS=manager->createParticleSystem(dename, 
"tracks/TurbopropHeatHaze");
                        smokeNode->attachObject(heathazePS);
                        heathazePS->setCastShadows(false);
+                       heathazePS->setVisibilityFlags(DEPTHMAP_DISABLED); // 
disable particles in depthmap
                }
        }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to