Force billboard to render in transparent phase, won't work otherwise
This commit is contained in:
parent
13f22ab1cd
commit
6d100a23d8
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user