36Ogre::CompositorPtr SDeferredCompositorLighting::GenerateCompositor(
SGBuffer* gBuffer)
38 Ogre::String compoName =
"SO3/Deferred/Compositor/"+
name +
"/"+ gBuffer->
GetName();
41 Ogre::CompositorPtr compositor = Ogre::CompositorManager::getSingleton().create(compoName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
44 Ogre::CompositionTechnique* compositionTechnique = compositor->createTechnique();
47 Ogre::CompositionTechnique::TextureDefinition* gBufferTexture = compositionTechnique->createTextureDefinition(
"mrt_output");
48 gBufferTexture->refCompName =
"SO3/Deferred/Compositor/GBuffer/" + gBuffer->
GetName();
49 gBufferTexture->refTexName =
"mrt_output";
52 Ogre::CompositionTargetPass* compositionTargetPass = compositionTechnique->getOutputTargetPass();
53 compositionTargetPass->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
54 compositionTargetPass->setShadowsEnabled(
false);
57 Ogre::CompositionPass* compositionPass = compositionTargetPass->createPass();
58 compositionPass->setType(Ogre::CompositionPass::PT_CLEAR);
61 compositionPass = compositionTargetPass->createPass();
62 compositionPass->setType(Ogre::CompositionPass::PT_RENDERSCENE);
63 compositionPass->setFirstRenderQueue(1);
67 compositionPass = compositionTargetPass->createPass();
68 compositionPass->setType(Ogre::CompositionPass::PT_RENDERCUSTOM);
69 compositionPass->setCustomType(
"DeferredLight");
71 for(
unsigned int i = 0; i<numberMrt; i++)
72 compositionPass->setInput(i,
"mrt_output", i);
75 compositionPass = compositionTargetPass->createPass();
76 compositionPass->setType(Ogre::CompositionPass::PT_RENDERSCENE);
79 compositionPass->setMaterialScheme(
"NoGBuffer");
82 compositionPass = compositionTargetPass->createPass();
83 compositionPass->setType(Ogre::CompositionPass::PT_RENDERSCENE);
std::string GetName() const
SDeferredCompositorLighting()
static const Ogre::uint8 PRE_GBUFFER_RENDER_QUEUE
static const Ogre::uint8 POST_GBUFFER_RENDER_QUEUE
unsigned int GetNumberMrt() const