[PARTLY MERGED] Several patches (yay patches!)

tzlaine

26-02-2009 16:13:42

Ok, I really love this addon. It has made my life vastly simpler. Thanks a bunch. In the spirit of thanks, here are two patches that I required to get things working for me. After these patches, I have ideas for two more.

First, the alternate coordinate system code is broken in a minor way -- someone is trying to write through a const reference. This fixes things:


Index: source/PagedGeometry.cpp
===================================================================
--- source/PagedGeometry.cpp (revision 2654)
+++ source/PagedGeometry.cpp (working copy)
@@ -255,14 +255,16 @@
if (!pageLoader)
return;

-#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
- point = _convertToLocal(point);
-#endif
-
std::list<GeometryPageManager *>::iterator it;
for (it = managerList.begin(); it != managerList.end(); ++it){
GeometryPageManager *mgr = *it;
- mgr->reloadGeometryPage(point);
+ mgr->reloadGeometryPage(
+#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
+ _convertToLocal(point)
+#else
+ point
+#endif
+ );
}
}

@@ -271,14 +273,16 @@
if (!pageLoader)
return;

-#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
- center = _convertToLocal(center);
-#endif
-
std::list<GeometryPageManager *>::iterator it;
for (it = managerList.begin(); it != managerList.end(); ++it){
GeometryPageManager *mgr = *it;
- mgr->reloadGeometryPages(center, radius);
+ mgr->reloadGeometryPages(
+#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
+ _convertToLocal(center)
+#else
+ center
+#endif
+ , radius);
}
}



Second, I have a rather complicated rendering setup, since I'm doing some texture composition that requires multiple passes, plus I have a glow-rendering pass, plus I use the selection highlighting shaders from the forums. This means I'm using numerous render queues. One of these is RENDER_QUEUE_6 + 1, which PagedGeometry uses. This produces the humorous result that my "tree" (actually, asteroid) impostors are rendered on top of some totally unrelated texture. So, the fix I propose is for the user to pass an int parameter to addDetailLevel<ImpostorPage>() indicating the desired queue in which the impostors should be created. Here is the patch. It is textually large, but conceptually it's dead simple. We just propagate this impostor render queue from the addDetailLevel<ImpostorPage>() all the way down to ImpostorTexture.


Index: source/ImpostorPage.cpp
===================================================================
--- source/ImpostorPage.cpp (revision 2654)
+++ source/ImpostorPage.cpp (working copy)
@@ -52,6 +52,12 @@
geom->getSceneNode()->createChildSceneNode("ImpostorPage::cameraNode");
ResourceGroupManager::getSingleton().createResourceGroup("Impostors");
}
+
+ if (const int *queue = any_cast<int>(&data)){
+ renderQueueGroup = *queue;
+ } else {
+ renderQueueGroup = RENDER_QUEUE_6 + 1;
+ }
}

ImpostorPage::~ImpostorPage()
@@ -84,7 +90,7 @@
void ImpostorPage::addEntity(Entity *ent, const Vector3 &position, const Quaternion &rotation, const Vector3 &scale, const Ogre::ColourValue &color)
{
//Get the impostor batch that this impostor will be added to
- ImpostorBatch *ibatch = ImpostorBatch::getBatch(this, ent);
+ ImpostorBatch *ibatch = ImpostorBatch::getBatch(this, ent, renderQueueGroup);

//Then add the impostor to the batch
ibatch->addBillboard(position, rotation, scale, color);
@@ -173,7 +179,7 @@

void ImpostorPage::regenerate(Entity *ent)
{
- ImpostorTexture *tex = ImpostorTexture::getTexture(NULL, ent);
+ ImpostorTexture *tex = ImpostorTexture::getTexture(ent);
if (tex != NULL)
tex->regenerate();
}
@@ -194,10 +200,10 @@

unsigned long ImpostorBatch::GUID = 0;

-ImpostorBatch::ImpostorBatch(ImpostorPage *group, Entity *entity)
+ImpostorBatch::ImpostorBatch(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Render impostor texture for this entity
- tex = ImpostorTexture::getTexture(group, entity);
+ tex = ImpostorTexture::getTexture(group, entity, renderQueueGroup);

//Create billboard set
bbset = new StaticBillboardSet(group->sceneMgr, group->geom->getSceneNode());
@@ -224,7 +230,7 @@

//Returns a pointer to an ImpostorBatch for the specified entity in the specified
//ImpostorPage. If one does not already exist, one will automatically be created.
-ImpostorBatch *ImpostorBatch::getBatch(ImpostorPage *group, Entity *entity)
+ImpostorBatch *ImpostorBatch::getBatch(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Search for an existing impostor batch for this entity
String entityKey = ImpostorBatch::generateEntityKey(entity);
@@ -237,7 +243,7 @@
return iter->second;
} else {
//Otherwise, create a new batch
- ImpostorBatch *batch = new ImpostorBatch(group, entity);
+ ImpostorBatch *batch = new ImpostorBatch(group, entity, renderQueueGroup);

//Add it to the impostorBatches list
typedef std::pair<String, ImpostorBatch *> ListItem;
@@ -333,8 +339,8 @@

//Do not use this constructor yourself - instead, call getTexture()
//to get/create an ImpostorTexture for an Entity.
-ImpostorTexture::ImpostorTexture(ImpostorPage *group, Entity *entity)
-: loader(0)
+ImpostorTexture::ImpostorTexture(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroupID)
+: loader(0), renderQueueGroup(renderQueueGroupID)
{
//Store scene manager and entity
ImpostorTexture::sceneMgr = group->sceneMgr;
@@ -525,10 +531,10 @@
Ogre::SceneManager::SpecialCaseRenderQueueMode OldSpecialCaseRenderQueueMode = sceneMgr->getSpecialCaseRenderQueueMode();
//Only render the entity
sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_INCLUDE);
- sceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_6 + 1);
+ sceneMgr->addSpecialCaseRenderQueue(renderQueueGroup);

uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();
- entity->setRenderQueueGroup(RENDER_QUEUE_6 + 1);
+ entity->setRenderQueueGroup(renderQueueGroup);
bool oldVisible = entity->getVisible();
entity->setVisible(true);
float oldMaxDistance = entity->getRenderingDistance();
@@ -609,7 +615,7 @@
entity->setVisible(oldVisible);
entity->setRenderQueueGroup(oldRenderQueueGroup);
entity->setRenderingDistance(oldMaxDistance);
- sceneMgr->removeSpecialCaseRenderQueue(RENDER_QUEUE_6 + 1);
+ sceneMgr->removeSpecialCaseRenderQueue(renderQueueGroup);
// Restore original state
sceneMgr->setSpecialCaseRenderQueueMode(OldSpecialCaseRenderQueueMode);

@@ -670,7 +676,7 @@
// no need to anything if it was not found, chances are that it was already deleted
}

-ImpostorTexture *ImpostorTexture::getTexture(ImpostorPage *group, Entity *entity)
+ImpostorTexture *ImpostorTexture::getTexture(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Search for an existing impostor texture for the given entity
String entityKey = ImpostorBatch::generateEntityKey(entity);
@@ -682,13 +688,25 @@
//Return it
return iter->second;
} else {
- if (group){
- //Otherwise, return a new texture
- return (new ImpostorTexture(group, entity));
- } else {
- //But if group is null, return null
- return NULL;
- }
+ assert(group);
+ //Otherwise, return a new texture
+ return (new ImpostorTexture(group, entity, renderQueueGroup));
}
}
+
+ImpostorTexture *ImpostorTexture::getTexture(Entity *entity)
+{
+ //Search for an existing impostor texture for the given entity
+ String entityKey = ImpostorBatch::generateEntityKey(entity);
+ std::map<String, ImpostorTexture *>::iterator iter;
+ iter = selfList.find(entityKey);
+
+ //If found..
+ if (iter != selfList.end()){
+ //Return it
+ return iter->second;
+ } else {
+ return NULL;
+ }
}
+}
Index: include/ImpostorPage.h
===================================================================
--- include/ImpostorPage.h (revision 2654)
+++ include/ImpostorPage.h (working copy)
@@ -199,7 +199,9 @@

Ogre::Vector3 center;
int aveCount;
-
+
+ Ogre::uint8 renderQueueGroup;
+
std::map<Ogre::String, ImpostorBatch *> impostorBatches;
};

@@ -211,7 +213,7 @@
class ImpostorBatch
{
public:
- static ImpostorBatch *getBatch(ImpostorPage *group, Ogre::Entity *entity);
+ static ImpostorBatch *getBatch(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);
~ImpostorBatch();

inline void build()
@@ -241,7 +243,7 @@
static Ogre::String generateEntityKey(Ogre::Entity *entity);

protected:
- ImpostorBatch(ImpostorPage *group, Ogre::Entity *entity);
+ ImpostorBatch(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);

ImpostorTexture *tex;
StaticBillboardSet *bbset;
@@ -295,8 +297,13 @@
/** Returns a pointer to an ImpostorTexture for the specified entity. If one does not
already exist, one will automatically be created.
*/
- static ImpostorTexture *getTexture(ImpostorPage *group, Ogre::Entity *entity);
+ static ImpostorTexture *getTexture(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);

+ /** Returns a pointer to an ImpostorTexture for the specified entity, or NUL if one
+ does not already exist.
+ */
+ static ImpostorTexture *getTexture(Ogre::Entity *entity);
+
/** remove created texture, note that all of the ImposterTextures
must be deleted at once, because there is no track if a texture is still
being used by something else
@@ -309,7 +316,7 @@
~ImpostorTexture();

protected:
- ImpostorTexture(ImpostorPage *group, Ogre::Entity *entity);
+ ImpostorTexture(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroupID);

void renderTextures(bool force); // Renders the impostor texture grid
void updateMaterials(); // Updates the materials to use the latest rendered impostor texture grid
@@ -329,6 +336,8 @@
float entityDiameter, entityRadius;
Ogre::Vector3 entityCenter;

+ Ogre::uint8 renderQueueGroup;
+
static unsigned long GUID;
static inline Ogre::String getUniqueID(const Ogre::String &prefix)
{


Now, as I mentioned, I also do a glow rendering pass. This means I need to tag my entities with visibility flags and only render the glowing objects during the glow pass. Since PagedGeometry creates several entities but does not set any visibility flags on them, all my PagedGeometry objects glow! So, I did this quick-and-dirty hack to get things working for me:


Index: source/StaticBillboardSet.cpp
===================================================================
--- source/StaticBillboardSet.cpp (revision 2654)
+++ source/StaticBillboardSet.cpp (working copy)
@@ -434,6 +434,8 @@

//Create an entity for the mesh
entity = sceneMgr->createEntity(entityName, mesh->getName());
+ const Ogre::uint32 REGULAR_OBJECTS_MASK = 1;
+ entity->setVisibilityFlags(REGULAR_OBJECTS_MASK);
entity->setCastShadows(false);

//Apply texture
Index: source/BatchedGeometry.cpp
===================================================================
--- source/BatchedGeometry.cpp (revision 2654)
+++ source/BatchedGeometry.cpp (working copy)
@@ -298,6 +298,9 @@
i->second->build();
}

+ const Ogre::uint32 REGULAR_OBJECTS_MASK = 1;
+ setVisibilityFlags(REGULAR_OBJECTS_MASK);
+
//Attach the batch to the scene node
sceneNode->attachObject(this);



I have an idea for a proper fix, but wanted feedback before making such a change. If there is interest, I can make a patch for the proper fix. The idea is to maintain a visibility mask which is the union of the visibility masks seen on all entities added to the loader. Then, when creating impostor billboards or batched geometry nodes, the union-mask would be applied where indicated above.

Finally, I have a patch that allows all the PagedGeometry code to build without errors with GCC 4.3.2, if you're interested. The changes are trivial.

tdev

29-06-2009 11:07:14

Ok, I really love this addon. It has made my life vastly simpler. Thanks a bunch. In the spirit of thanks, here are two patches that I required to get things working for me. After these patches, I have ideas for two more.

First, the alternate coordinate system code is broken in a minor way -- someone is trying to write through a const reference. This fixes things:


Index: source/PagedGeometry.cpp
===================================================================
--- source/PagedGeometry.cpp (revision 2654)
+++ source/PagedGeometry.cpp (working copy)
@@ -255,14 +255,16 @@
if (!pageLoader)
return;

-#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
- point = _convertToLocal(point);
-#endif
-
std::list<GeometryPageManager *>::iterator it;
for (it = managerList.begin(); it != managerList.end(); ++it){
GeometryPageManager *mgr = *it;
- mgr->reloadGeometryPage(point);
+ mgr->reloadGeometryPage(
+#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
+ _convertToLocal(point)
+#else
+ point
+#endif
+ );
}
}

@@ -271,14 +273,16 @@
if (!pageLoader)
return;

-#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
- center = _convertToLocal(center);
-#endif
-
std::list<GeometryPageManager *>::iterator it;
for (it = managerList.begin(); it != managerList.end(); ++it){
GeometryPageManager *mgr = *it;
- mgr->reloadGeometryPages(center, radius);
+ mgr->reloadGeometryPages(
+#ifdef PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM
+ _convertToLocal(center)
+#else
+ center
+#endif
+ , radius);
}
}



Second, I have a rather complicated rendering setup, since I'm doing some texture composition that requires multiple passes, plus I have a glow-rendering pass, plus I use the selection highlighting shaders from the forums. This means I'm using numerous render queues. One of these is RENDER_QUEUE_6 + 1, which PagedGeometry uses. This produces the humorous result that my "tree" (actually, asteroid) impostors are rendered on top of some totally unrelated texture. So, the fix I propose is for the user to pass an int parameter to addDetailLevel<ImpostorPage>() indicating the desired queue in which the impostors should be created. Here is the patch. It is textually large, but conceptually it's dead simple. We just propagate this impostor render queue from the addDetailLevel<ImpostorPage>() all the way down to ImpostorTexture.


Index: source/ImpostorPage.cpp
===================================================================
--- source/ImpostorPage.cpp (revision 2654)
+++ source/ImpostorPage.cpp (working copy)
@@ -52,6 +52,12 @@
geom->getSceneNode()->createChildSceneNode("ImpostorPage::cameraNode");
ResourceGroupManager::getSingleton().createResourceGroup("Impostors");
}
+
+ if (const int *queue = any_cast<int>(&data)){
+ renderQueueGroup = *queue;
+ } else {
+ renderQueueGroup = RENDER_QUEUE_6 + 1;
+ }
}

ImpostorPage::~ImpostorPage()
@@ -84,7 +90,7 @@
void ImpostorPage::addEntity(Entity *ent, const Vector3 &position, const Quaternion &rotation, const Vector3 &scale, const Ogre::ColourValue &color)
{
//Get the impostor batch that this impostor will be added to
- ImpostorBatch *ibatch = ImpostorBatch::getBatch(this, ent);
+ ImpostorBatch *ibatch = ImpostorBatch::getBatch(this, ent, renderQueueGroup);

//Then add the impostor to the batch
ibatch->addBillboard(position, rotation, scale, color);
@@ -173,7 +179,7 @@

void ImpostorPage::regenerate(Entity *ent)
{
- ImpostorTexture *tex = ImpostorTexture::getTexture(NULL, ent);
+ ImpostorTexture *tex = ImpostorTexture::getTexture(ent);
if (tex != NULL)
tex->regenerate();
}
@@ -194,10 +200,10 @@

unsigned long ImpostorBatch::GUID = 0;

-ImpostorBatch::ImpostorBatch(ImpostorPage *group, Entity *entity)
+ImpostorBatch::ImpostorBatch(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Render impostor texture for this entity
- tex = ImpostorTexture::getTexture(group, entity);
+ tex = ImpostorTexture::getTexture(group, entity, renderQueueGroup);

//Create billboard set
bbset = new StaticBillboardSet(group->sceneMgr, group->geom->getSceneNode());
@@ -224,7 +230,7 @@

//Returns a pointer to an ImpostorBatch for the specified entity in the specified
//ImpostorPage. If one does not already exist, one will automatically be created.
-ImpostorBatch *ImpostorBatch::getBatch(ImpostorPage *group, Entity *entity)
+ImpostorBatch *ImpostorBatch::getBatch(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Search for an existing impostor batch for this entity
String entityKey = ImpostorBatch::generateEntityKey(entity);
@@ -237,7 +243,7 @@
return iter->second;
} else {
//Otherwise, create a new batch
- ImpostorBatch *batch = new ImpostorBatch(group, entity);
+ ImpostorBatch *batch = new ImpostorBatch(group, entity, renderQueueGroup);

//Add it to the impostorBatches list
typedef std::pair<String, ImpostorBatch *> ListItem;
@@ -333,8 +339,8 @@

//Do not use this constructor yourself - instead, call getTexture()
//to get/create an ImpostorTexture for an Entity.
-ImpostorTexture::ImpostorTexture(ImpostorPage *group, Entity *entity)
-: loader(0)
+ImpostorTexture::ImpostorTexture(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroupID)
+: loader(0), renderQueueGroup(renderQueueGroupID)
{
//Store scene manager and entity
ImpostorTexture::sceneMgr = group->sceneMgr;
@@ -525,10 +531,10 @@
Ogre::SceneManager::SpecialCaseRenderQueueMode OldSpecialCaseRenderQueueMode = sceneMgr->getSpecialCaseRenderQueueMode();
//Only render the entity
sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_INCLUDE);
- sceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_6 + 1);
+ sceneMgr->addSpecialCaseRenderQueue(renderQueueGroup);

uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();
- entity->setRenderQueueGroup(RENDER_QUEUE_6 + 1);
+ entity->setRenderQueueGroup(renderQueueGroup);
bool oldVisible = entity->getVisible();
entity->setVisible(true);
float oldMaxDistance = entity->getRenderingDistance();
@@ -609,7 +615,7 @@
entity->setVisible(oldVisible);
entity->setRenderQueueGroup(oldRenderQueueGroup);
entity->setRenderingDistance(oldMaxDistance);
- sceneMgr->removeSpecialCaseRenderQueue(RENDER_QUEUE_6 + 1);
+ sceneMgr->removeSpecialCaseRenderQueue(renderQueueGroup);
// Restore original state
sceneMgr->setSpecialCaseRenderQueueMode(OldSpecialCaseRenderQueueMode);

@@ -670,7 +676,7 @@
// no need to anything if it was not found, chances are that it was already deleted
}

-ImpostorTexture *ImpostorTexture::getTexture(ImpostorPage *group, Entity *entity)
+ImpostorTexture *ImpostorTexture::getTexture(ImpostorPage *group, Entity *entity, Ogre::uint8 renderQueueGroup)
{
//Search for an existing impostor texture for the given entity
String entityKey = ImpostorBatch::generateEntityKey(entity);
@@ -682,13 +688,25 @@
//Return it
return iter->second;
} else {
- if (group){
- //Otherwise, return a new texture
- return (new ImpostorTexture(group, entity));
- } else {
- //But if group is null, return null
- return NULL;
- }
+ assert(group);
+ //Otherwise, return a new texture
+ return (new ImpostorTexture(group, entity, renderQueueGroup));
}
}
+
+ImpostorTexture *ImpostorTexture::getTexture(Entity *entity)
+{
+ //Search for an existing impostor texture for the given entity
+ String entityKey = ImpostorBatch::generateEntityKey(entity);
+ std::map<String, ImpostorTexture *>::iterator iter;
+ iter = selfList.find(entityKey);
+
+ //If found..
+ if (iter != selfList.end()){
+ //Return it
+ return iter->second;
+ } else {
+ return NULL;
+ }
}
+}
Index: include/ImpostorPage.h
===================================================================
--- include/ImpostorPage.h (revision 2654)
+++ include/ImpostorPage.h (working copy)
@@ -199,7 +199,9 @@

Ogre::Vector3 center;
int aveCount;
-
+
+ Ogre::uint8 renderQueueGroup;
+
std::map<Ogre::String, ImpostorBatch *> impostorBatches;
};

@@ -211,7 +213,7 @@
class ImpostorBatch
{
public:
- static ImpostorBatch *getBatch(ImpostorPage *group, Ogre::Entity *entity);
+ static ImpostorBatch *getBatch(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);
~ImpostorBatch();

inline void build()
@@ -241,7 +243,7 @@
static Ogre::String generateEntityKey(Ogre::Entity *entity);

protected:
- ImpostorBatch(ImpostorPage *group, Ogre::Entity *entity);
+ ImpostorBatch(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);

ImpostorTexture *tex;
StaticBillboardSet *bbset;
@@ -295,8 +297,13 @@
/** Returns a pointer to an ImpostorTexture for the specified entity. If one does not
already exist, one will automatically be created.
*/
- static ImpostorTexture *getTexture(ImpostorPage *group, Ogre::Entity *entity);
+ static ImpostorTexture *getTexture(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroup);

+ /** Returns a pointer to an ImpostorTexture for the specified entity, or NUL if one
+ does not already exist.
+ */
+ static ImpostorTexture *getTexture(Ogre::Entity *entity);
+
/** remove created texture, note that all of the ImposterTextures
must be deleted at once, because there is no track if a texture is still
being used by something else
@@ -309,7 +316,7 @@
~ImpostorTexture();

protected:
- ImpostorTexture(ImpostorPage *group, Ogre::Entity *entity);
+ ImpostorTexture(ImpostorPage *group, Ogre::Entity *entity, Ogre::uint8 renderQueueGroupID);

void renderTextures(bool force); // Renders the impostor texture grid
void updateMaterials(); // Updates the materials to use the latest rendered impostor texture grid
@@ -329,6 +336,8 @@
float entityDiameter, entityRadius;
Ogre::Vector3 entityCenter;

+ Ogre::uint8 renderQueueGroup;
+
static unsigned long GUID;
static inline Ogre::String getUniqueID(const Ogre::String &prefix)
{


Now, as I mentioned, I also do a glow rendering pass. This means I need to tag my entities with visibility flags and only render the glowing objects during the glow pass. Since PagedGeometry creates several entities but does not set any visibility flags on them, all my PagedGeometry objects glow! So, I did this quick-and-dirty hack to get things working for me:


Index: source/StaticBillboardSet.cpp
===================================================================
--- source/StaticBillboardSet.cpp (revision 2654)
+++ source/StaticBillboardSet.cpp (working copy)
@@ -434,6 +434,8 @@

//Create an entity for the mesh
entity = sceneMgr->createEntity(entityName, mesh->getName());
+ const Ogre::uint32 REGULAR_OBJECTS_MASK = 1;
+ entity->setVisibilityFlags(REGULAR_OBJECTS_MASK);
entity->setCastShadows(false);

//Apply texture
Index: source/BatchedGeometry.cpp
===================================================================
--- source/BatchedGeometry.cpp (revision 2654)
+++ source/BatchedGeometry.cpp (working copy)
@@ -298,6 +298,9 @@
i->second->build();
}

+ const Ogre::uint32 REGULAR_OBJECTS_MASK = 1;
+ setVisibilityFlags(REGULAR_OBJECTS_MASK);
+
//Attach the batch to the scene node
sceneNode->attachObject(this);



I have an idea for a proper fix, but wanted feedback before making such a change. If there is interest, I can make a patch for the proper fix. The idea is to maintain a visibility mask which is the union of the visibility masks seen on all entities added to the loader. Then, when creating impostor billboards or batched geometry nodes, the union-mask would be applied where indicated above.

Finally, I have a patch that allows all the PagedGeometry code to build without errors with GCC 4.3.2, if you're interested. The changes are trivial.


merged patch for PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM.
not merged your mask patches, could you provide the improved patch you talked about as well? :)

would be nice to have the gcc4.3.2 patches also :)