Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h	(revision 2840)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h	(revision 2841)
@@ -63,7 +63,8 @@
 
 
+	void GetCurrentLODLevel(ShapeContainer &shapes);
+
 protected:
 
-	ShapeContainer *GetCurrentLOD();
 
 	/// transform matrix 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.cpp	(revision 2840)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.cpp	(revision 2841)
@@ -59,14 +59,11 @@
 
 
-bool RenderQueue::FitsInBucket(Shape *ent, size_t idx) const
-{
-#ifdef TODO
-	Material *mat = ent->GetMaterial();
-#else
-	Material *mat = NULL;
-#endif
+bool RenderQueue::FitsInBucket(Shape *shape, size_t idx) const
+{
+	Material *mat = shape->GetMaterial();
+
 	// test if entity belongs to this bucket
 	// note: rather slows down the application for some reason!!
-	if (0 && mat->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled)
+	if (mat->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled)
 		return false;
 
@@ -91,7 +88,23 @@
 void RenderQueue::Enqueue(SceneEntity *entity)
 {
+	static ShapeContainer shapes;
+	shapes.clear();
+
+	entity->GetCurrentLODLevel(shapes)
+
+	ShapeContainer::const_iterator sit, sit_end = shapes.end();
+
+	for (sit = shapes.begin(); sit != sit_end; ++ sit)
+	{
+		Enqueue(*sit);
+	}
+}
+
+
+void RenderQueue::Enqueue(Shape *shape)
+{
 	RenderQueueBucket *bucket;
 	++ mSize;
-#ifdef TODO
+	
 	if (entity->mRenderQueueBucket)
 	{
@@ -141,6 +154,4 @@
 
 	bucket->mEntities.push_back(entity);
-#endif
-
 }
 
@@ -195,9 +206,7 @@
 			Material *mat = shape->GetMaterial();
 			int tsize = mat->GetTexture() ? mat->GetTexture()->GetByteSize() : 0;
-#ifdef TODO
+			
 			float dist = SqrMagnitude(shape->GetBoundingBox().Center() - mCamera->GetPosition());
-#else
-			float dist = -1;
-#endif
+			
 			Debug << "e: " << shape << " a: " << mat->IsAlphaTestEnabled() << " s: " << tsize << " d: " << dist << " " << endl;
 		}
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.h	(revision 2839)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.h	(revision 2841)
@@ -70,4 +70,6 @@
 protected:
 
+	void Enqueue(Shape *shape);
+
 	inline bool FitsInBucket(Shape *shape, size_t idx) const;
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp	(revision 2840)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp	(revision 2841)
@@ -22,8 +22,12 @@
 
 
-ShapeContainer *SceneEntity::GetCurrentLOD()
+void SceneEntity::GetCurrentLODLevel(ShapeContainer &shapes)
 {
-/*	if (mLODInfos->empty())
-		return &mShapes;
+	ShapeContainer::const_iterator sit, sit_end;
+
+	if (mLODInfos->empty())
+	{
+		sit = mShapes.begin(); sit_end = mShapes.end();
+	}
 
 	float mDistance = 0.0f;
@@ -31,13 +35,24 @@
 	int i = 0;
 
-	for (int i = 0; i < mLODInfos->size(); ++ i)
+	LODInfo *info;
+
+	LODInfoContainer::const_iterator lid, lid_end = mLODInfos.end();
+
+	for (lid = mLODInfos.begin(); lid != lid_end; ++ lid)
 	{
-		if ((mLODInfos*)[i].mDistance > mDistance)
-			return &(mLODInfos*)[i].mShapes;
+		info = *lid;
+
+		if (info->mDistance > mDistance)
+		{
+			sit = info->mShapes.begin(); 
+			sit_end = info->mShapes.end();
+			break;
+		}
 	}
 
-	return &(mLODInfos->last().mShapes);
-	*/
-	return NULL;
+	for (; sit != sit_end; ++ sit)
+	{
+		shapes.push_back(*sit);
+	}
 }
 
@@ -48,11 +63,14 @@
 	float mDistance = 0.0f;
 
-	ShapeContainer *shapes;
+	static ShapeContainer shapes;
+	shapes.clear();
 
-	shapes = GetCurrentLOD();
+	GetCurrentLODLevel(shapes);
 
-	for (int i = 0; i < shapes->size(); ++ i)
+	ShapeContainer::const_iterator sit, sit_end = shapes.end();
+
+	for (; sit != sit_end; ++ sit)
 	{
-		(*shapes)[i]->Render(state);
+		(*sit)->Render(state);
 	}
 }
