mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Document RenderBin numbers in a common header to keep them organised
This commit is contained in:
parent
d191a52847
commit
89d9323c2b
4 changed files with 26 additions and 3 deletions
|
@ -23,6 +23,7 @@ add_openmw_dir (mwrender
|
|||
actors objects renderingmanager animation rotatecontroller sky npcanimation vismask
|
||||
creatureanimation effectmanager util renderinginterface pathgrid rendermode weaponanimation
|
||||
bulletdebugdraw globalmap characterpreview camera localmap water terrainstorage ripplesimulation
|
||||
renderbin
|
||||
)
|
||||
|
||||
add_openmw_dir (mwinput
|
||||
|
|
20
apps/openmw/mwrender/renderbin.hpp
Normal file
20
apps/openmw/mwrender/renderbin.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef OPENMW_MWRENDER_RENDERBIN_H
|
||||
#define OPENMW_MWRENDER_RENDERBIN_H
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
||||
/// Defines the render bin numbers used in the OpenMW scene graph. The bin with the lowest number is rendered first.
|
||||
/// Beware of RenderBin nesting, in most cases you will want to use setNestRenderBins(false).
|
||||
enum RenderBins
|
||||
{
|
||||
RenderBin_Sky = -1,
|
||||
RenderBin_Default = 0,
|
||||
RenderBin_Water = 9,
|
||||
RenderBin_OcclusionQuery = 10,
|
||||
RenderBin_SunGlare = 11
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -41,6 +41,7 @@
|
|||
#include "../mwworld/fallback.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
#include "renderbin.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -376,7 +377,7 @@ public:
|
|||
osg::ref_ptr<osg::PositionAttitudeTransform> queryTransform (new osg::PositionAttitudeTransform);
|
||||
queryTransform->setScale(osg::Vec3f(0.5f, 0.5f, 0.5f));
|
||||
// Need to render after the world geometry so we can correctly test for occlusions
|
||||
queryTransform->getOrCreateStateSet()->setRenderBinDetails(10, "RenderBin");
|
||||
queryTransform->getOrCreateStateSet()->setRenderBinDetails(RenderBin_OcclusionQuery, "RenderBin");
|
||||
queryTransform->getOrCreateStateSet()->setNestRenderBins(false);
|
||||
|
||||
mTransform->addChild(queryTransform);
|
||||
|
@ -680,7 +681,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
|||
mRootNode = skyroot;
|
||||
|
||||
// By default render before the world is rendered
|
||||
mRootNode->getOrCreateStateSet()->setRenderBinDetails(-1, "RenderBin");
|
||||
mRootNode->getOrCreateStateSet()->setRenderBinDetails(RenderBin_Sky, "RenderBin");
|
||||
}
|
||||
|
||||
void SkyManager::create()
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "vismask.hpp"
|
||||
#include "ripplesimulation.hpp"
|
||||
#include "renderbin.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -86,7 +87,7 @@ namespace
|
|||
depth->setWriteMask(false);
|
||||
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
||||
|
||||
stateset->setRenderBinDetails(9, "RenderBin");
|
||||
stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");
|
||||
|
||||
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
|
||||
for (int i=0; i<32; ++i)
|
||||
|
|
Loading…
Reference in a new issue