Force billboard to render in transparent phase, won't work otherwise

This commit is contained in:
Marianne Gagnon 2014-07-28 18:29:10 -04:00
parent 13f22ab1cd
commit 6d100a23d8
2 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,7 @@
#include "graphics/glwrap.hpp"
#include "graphics/shaders.hpp"
#include "graphics/irr_driver.hpp"
#include <ISceneManager.h>
using namespace irr;
@ -28,6 +29,17 @@ STKBillboard::STKBillboard(irr::scene::ISceneNode* parent, irr::scene::ISceneMan
createbillboardvao();
}
void STKBillboard::OnRegisterSceneNode()
{
if (IsVisible)
{
SceneManager->registerNodeForRendering(this, scene::ESNRP_TRANSPARENT);
}
ISceneNode::OnRegisterSceneNode();
}
void STKBillboard::render()
{
if (irr_driver->getPhase() != TRANSPARENT_PASS)

View File

@ -4,6 +4,7 @@
#include "../lib/irrlicht/source/Irrlicht/CBillboardSceneNode.h"
#include <IBillboardSceneNode.h>
#include <irrTypes.h>
#include "utils/cpp2011.h"
class STKBillboard : public irr::scene::CBillboardSceneNode
{
@ -13,7 +14,9 @@ public:
irr::video::SColor colorTop = irr::video::SColor(0xFFFFFFFF),
irr::video::SColor colorBottom = irr::video::SColor(0xFFFFFFFF));
virtual void render();
virtual void OnRegisterSceneNode() OVERRIDE;
virtual void render() OVERRIDE;
};
#endif