36Ogre::CompositorPtr SDeferredCompositorGBuffer::GenerateCompositor(
SGBuffer* gBuffer)
38 Ogre::String compoName =
"SO3/Deferred/Compositor/GBuffer/"+ gBuffer->
GetName();
41 Ogre::CompositorPtr compositor = Ogre::CompositorManager::getSingleton().create(compoName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
44 Ogre::CompositionTechnique* compositionTechnique = compositor->createTechnique();
45 compositionTechnique->removeAllTargetPasses();
46 compositionTechnique->removeAllTextureDefinitions();
49 Ogre::CompositionTechnique::TextureDefinition* gBufferTexture = compositionTechnique->createTextureDefinition(
"mrt_output");
50 gBufferTexture->width = 0;
51 gBufferTexture->height = 0;
52 Ogre::PixelFormatList pixelFormatList;
54 for(
unsigned int i = 0; i<numberMrt; i++)
55 pixelFormatList.push_back(Ogre::PF_FLOAT16_RGBA);
56 gBufferTexture->formatList = pixelFormatList;
57 gBufferTexture->scope = Ogre::CompositionTechnique::TS_CHAIN;
60 Ogre::CompositionTargetPass* compositionTargetPass = compositionTechnique->createTargetPass();
61 compositionTargetPass->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
62 compositionTargetPass->setOutputName(
"mrt_output");
65 Ogre::CompositionPass* compositionPass = compositionTargetPass->createPass();
66 compositionPass->setType(Ogre::CompositionPass::PT_CLEAR);
69 compositionTargetPass->setShadowsEnabled(
false);
70 compositionTargetPass->setMaterialScheme(
"GBuffer");
73 compositionPass = compositionTargetPass->createPass();
74 compositionPass->setType(Ogre::CompositionPass::PT_RENDERSCENE);
std::string GetName() const
SDeferredCompositorGBuffer()
static const Ogre::uint8 PRE_GBUFFER_RENDER_QUEUE
static const Ogre::uint8 POST_GBUFFER_RENDER_QUEUE
unsigned int GetNumberMrt() const