Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-21 12:55:12 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-21 12:55:12 +0400
commite78ef29a593857d87b0c35c211d082c8caa80f7b (patch)
treef116204149c3e29cd57b7b2d2bfd629d61dbe479 /source/gameengine/Rasterizer/RAS_BucketManager.h
parent2a622e35d4f96a805ab0de22f34d6ae3661a0a53 (diff)
Depth sorting for alpha mesh objects.
- Mesh Objects are sorted by depth (based on object centre.) Using object centre means the user has control over the sort. - Polygons are not sorted. - Polygons are not split. - O(nlog(n))
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_BucketManager.h')
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 834ae574bbc..9d7c5a4b05a 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -43,13 +43,42 @@
class RAS_BucketManager
{
//GEN_Map<class RAS_IPolyMaterial,class RAS_MaterialBucket*> m_MaterialBuckets;
- std::vector<class RAS_MaterialBucket*> m_MaterialBuckets;
- std::vector<class RAS_MaterialBucket*> m_AlphaBuckets;
+
+ typedef std::vector<class RAS_MaterialBucket*> BucketList;
+ BucketList m_MaterialBuckets;
+ BucketList m_AlphaBuckets;
+
+ /**
+ * struct alphamesh holds a mesh, (m_ms) it's depth, (m_z) and the bucket it came from (m_bucket.)
+ */
+ struct alphamesh
+ {
+ public:
+ MT_Scalar m_z;
+ RAS_MaterialBucket::T_MeshSlotList::iterator m_ms;
+ RAS_MaterialBucket *m_bucket;
+ alphamesh(MT_Scalar z, RAS_MaterialBucket::T_MeshSlotList::iterator &ms, RAS_MaterialBucket *bucket) :
+ m_z(z),
+ m_ms(ms),
+ m_bucket(bucket)
+ {}
+ };
+
+ struct backtofront
+ {
+ bool operator()(const alphamesh &a, const alphamesh &b)
+ {
+ return a.m_z < b.m_z;
+ }
+ };
+
public:
RAS_BucketManager();
virtual ~RAS_BucketManager();
+ void RenderAlphaBuckets(const MT_Transform& cameratrans,
+ RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
void Renderbuckets(const MT_Transform & cameratrans,
RAS_IRasterizer* rasty,
class RAS_IRenderTools* rendertools);