|
From: <axl...@us...> - 2009-08-21 01:17:39
|
Revision: 504
http://hgengine.svn.sourceforge.net/hgengine/?rev=504&view=rev
Author: axlecrusher
Date: 2009-08-21 01:17:31 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Improve culling, excludeCull is supposed to mean ignore cull so change the name.
Ignoring the cull means that the asset will not influence the cull either way. Textures are an example of this,
since they only apply to things rendered later their cull can be ignored, and just rely on the parent node's cull.
Quads were not supposed to be ignored, they have no bounding volume so they default to fail culling.
Modified Paths:
--------------
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/MercuryNode.cpp
Mercury2/src/Quad.cpp
Mercury2/src/Texture.cpp
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-08-21 00:58:05 UTC (rev 503)
+++ Mercury2/src/MercuryAsset.cpp 2009-08-21 01:17:31 UTC (rev 504)
@@ -6,7 +6,7 @@
extern bool DOOCCLUSIONCULL;
MercuryAsset::MercuryAsset()
- :m_isInstanced(false), m_boundingVolume(NULL), m_loadState(NONE), m_excludeFromCull(false)
+ :m_isInstanced(false), m_boundingVolume(NULL), m_loadState(NONE), m_ignoreCull(false)
{
}
@@ -63,9 +63,9 @@
void MercuryAsset::LoadFromXML(const XMLNode& node)
{
- if ( !node.Attribute("nocull").empty() )
+ if ( !node.Attribute("ignorecull").empty() )
{
- SetExcludeFromCull( node.Attribute("nocull")=="true" );
+ SetIgnoreCull( node.Attribute("ignorecull")=="true" );
}
}
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-08-21 00:58:05 UTC (rev 503)
+++ Mercury2/src/MercuryAsset.h 2009-08-21 01:17:31 UTC (rev 504)
@@ -56,8 +56,8 @@
virtual bool DoCullingTests(OcclusionResult& occlusion, const MercuryMatrix& matrix);
void DrawAxes();
- inline void SetExcludeFromCull(bool t) { m_excludeFromCull = t; }
- inline bool ExcludeFromCull() const { return m_excludeFromCull; }
+ inline void SetIgnoreCull(bool t) { m_ignoreCull = t; }
+ inline bool IgnoreCull() const { return m_ignoreCull; }
protected:
void SetLoadState(LoadState ls); //thread safe
LoadState GetLoadState(); //thread safe
@@ -68,7 +68,7 @@
private:
LoadState m_loadState;
MSemaphore m_lock;
- bool m_excludeFromCull;
+ bool m_ignoreCull;
};
/** This holds the per-instance data for each asset instance.
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-08-21 00:58:05 UTC (rev 503)
+++ Mercury2/src/MercuryNode.cpp 2009-08-21 01:17:31 UTC (rev 504)
@@ -276,14 +276,13 @@
MercuryAssetInstance& mai = *i;
MercuryAsset& a = mai.Asset();
- if ( !a.ExcludeFromCull() )
+ ///NOTE: Things that ignore culling do not affect culling one way or the other
+ if ( !a.IgnoreCull() )
{
mai.Culled( a.DoCullingTests( mai.GetOcclusionResult(), matrix ) );
culled = culled && mai.Culled();
}
- if ( a.ExcludeFromCull() ) culled = false; //node must be rendered if something was excluded
-
if ( !mai.Culled() ) a.PreRender(this);
}
SetCulled( culled );
Modified: Mercury2/src/Quad.cpp
===================================================================
--- Mercury2/src/Quad.cpp 2009-08-21 00:58:05 UTC (rev 503)
+++ Mercury2/src/Quad.cpp 2009-08-21 01:17:31 UTC (rev 504)
@@ -36,8 +36,6 @@
m_indexData[1] = 1;
m_indexData[3] = m_indexData[2] = 2;
m_indexData[4] = 3;
-
- SetExcludeFromCull( true );
}
Quad::~Quad()
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-08-21 00:58:05 UTC (rev 503)
+++ Mercury2/src/Texture.cpp 2009-08-21 01:17:31 UTC (rev 504)
@@ -19,7 +19,7 @@
m_numActiveTextures = 0;
}
- SetExcludeFromCull( true );
+ SetIgnoreCull( true );
}
Texture::~Texture()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|