include render order

pull/615/head
madsbuvi 4 years ago
parent 51a37ec6d2
commit beedba3354

@ -233,7 +233,7 @@ class Refraction : public SceneUtil::RTTNode
{
public:
Refraction(uint32_t rttSize)
: RTTNode(rttSize, rttSize, false)
: RTTNode(rttSize, rttSize, 1, false)
{
mClipCullNode = new ClipCullNode;
}
@ -297,7 +297,7 @@ class Reflection : public SceneUtil::RTTNode
{
public:
Reflection(uint32_t rttSize, bool isInterior)
: RTTNode(rttSize, rttSize, false)
: RTTNode(rttSize, rttSize, 0, false)
{
setInterior(isInterior);
mClipCullNode = new ClipCullNode;

@ -24,9 +24,10 @@ namespace SceneUtil
RTTNode* mGroup;
};
RTTNode::RTTNode(uint32_t textureWidth, uint32_t textureHeight, bool doPerViewMapping)
RTTNode::RTTNode(uint32_t textureWidth, uint32_t textureHeight, int renderOrderNum, bool doPerViewMapping)
: mTextureWidth(textureWidth)
, mTextureHeight(textureHeight)
, mRenderOrderNum(renderOrderNum)
, mDoPerViewMapping(doPerViewMapping)
{
addCullCallback(new CullCallback(this));
@ -66,7 +67,7 @@ namespace SceneUtil
mViewDependentDataMap[cv].reset(new ViewDependentData);
mViewDependentDataMap[cv]->mCamera = camera;
camera->setRenderOrder(osg::Camera::PRE_RENDER);
camera->setRenderOrder(osg::Camera::PRE_RENDER, mRenderOrderNum);
camera->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
camera->setViewport(0, 0, mTextureWidth, mTextureHeight);

@ -32,7 +32,7 @@ namespace SceneUtil
class RTTNode : public osg::Node
{
public:
RTTNode(uint32_t textureWidth, uint32_t textureHeight, bool doPerViewMapping);
RTTNode(uint32_t textureWidth, uint32_t textureHeight, int renderOrderNum, bool doPerViewMapping);
~RTTNode();
osg::Texture* getColorTexture(osgUtil::CullVisitor* cv);
@ -61,6 +61,7 @@ namespace SceneUtil
ViewDependentDataMap mViewDependentDataMap;
uint32_t mTextureWidth;
uint32_t mTextureHeight;
int mRenderOrderNum;
bool mDoPerViewMapping;
};
}

Loading…
Cancel
Save