SO3Engine
SO3CompositorPass.cpp
Go to the documentation of this file.
1
5#include <boost/format.hpp>
6
9
10namespace SO3
11{
12
13SCompositorPass::SCompositorPass(SCompositorTarget* target, Ogre::CompositionPass* ogrePassRef, int passId) : SData("")
14{
15 ogreCompositorPass = ogrePassRef;
16 parentTarget = target;
17 name = boost::str(boost::format("%1%") %passId);
18}
19
20SCompositorPass::SCompositorPass() : SData("")
21{
22 // Forbiden (private)
23}
24
28
30{
31 return static_cast<SCompositorPassType>(static_cast<int>(ogreCompositorPass->getType()));
32}
33
35{
36 SMaterial* material = 0;
37 if(ogreCompositorPass->getType() == Ogre::CompositionPass::PT_RENDERQUAD)
38 {
39 Ogre::Technique* ogreTechnique = 0;
40 Ogre::Material::Techniques suptechs = ogreCompositorPass->getMaterial()->getSupportedTechniques();
41 if (suptechs.size() > 0)
42 ogreTechnique = suptechs[0];
43
44 if (!ogreTechnique)
45 return 0;
46
47 Ogre::Any bindedSTechnique = ogreTechnique->getUserObjectBindings().getUserAny("STechnique");
48 if(bindedSTechnique.has_value())
49 {
50 STechnique* matTechnique = Ogre::any_cast<STechnique*> (bindedSTechnique);
51 material = matTechnique->GetParentMaterial();
52 }
53 }
54 return material;
55}
56
57}
SCompositorPassType GetType() const
SMaterial * GetMaterial() const
std::string name
Definition SO3DataScol.h:44
SMaterial * GetParentMaterial()