Currently, solids are drawn in an order based on their texture pointer. This makes it impossible to stack polygons based on a specific drawing order (for instance, like in Civilization--several layers, each drawn one at a time) (See: http://img401.imageshack.us/i/screenshot1008201019291.png/ as an example)
One solution is to replace the texture pointer sort with a sort based on a user-supplied value. This code is from http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=42749 :
Line 518 in CSceneManager.h:
[code]
struct DefaultNodeEntry
{
DefaultNodeEntry(ISceneNode* n) :
Node(n), sortValue(0) {
sortValue = n->sortValue;
}
bool operator < (const DefaultNodeEntry& other) const
{
return (sortValue < other.sortValue);
}
ISceneNode* Node;
private:
s32 sortValue;
};
[/code]
line 261 in ISceneNode.h: (I made this variable public... there is no need for it to be protected.)
[code]
// Sort value of the node.
s32 sortValue;
[/code]
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
I needed to paint a invisible rectangular mask into depth buffer and then paint an object so that as the object intersects with mask, part of it will become occluded.
I found no other solution to this problem than applying this patch.
I think user control in sorting is necessary.