Ejemplo n.º 1
0
Ogre::CompositorInstance::Listener* HDRLogic::createListener(Ogre::CompositorInstance* instance)
{
	HDRListener* listener = new HDRListener(mApp);
	Ogre::Viewport* vp = instance->getChain()->getViewport();
	listener->notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
	listener->mViewportWidth = vp->getActualWidth();
	listener->mViewportHeight = vp->getActualHeight();
	listener->notifyCompositor(instance);
	return listener;

/*	HDRCompositor* listener = new HDRCompositor(mApp);
	listener->SetToneMapper(compositor->GetToneMapper());
	listener->SetGlareType(compositor->GetGlareType());
	listener->SetStarType(compositor->GetStarType());
	listener->SetAutoKeying(compositor->GetAutoKeying());
	listener->SetKey(compositor->GetKey());
	listener->SetLumAdapdation(compositor->GetLumAdaption());
	listener->SetAdaptationScale(compositor->GetAdaptationScale());
	listener->SetStarPasses(compositor->GetStarPasses());
	listener->SetGlarePasses(compositor->GetGlarePasses());
	listener->SetGlareStrength(compositor->GetGlareStrength());
	listener->SetStarStrength(compositor->GetStarStrength());
		
	Ogre::Viewport* vp = instance->getChain()->getViewport();
	listener->notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
	return listener;
	*/
}
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
Ogre::CompositorInstance::Listener* HDRLogic::createListener(Ogre::CompositorInstance* instance)
{
	HDRListener* listener = new HDRListener;
	Ogre::Viewport* vp = instance->getChain()->getViewport();
	listener->notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
	listener->notifyCompositor(instance);
	return listener;
}
Ejemplo n.º 3
0
	void Main::InitCompositor()
	{
		mSceneRenderCompositor = Ogre::CompositorManager::getSingleton().addCompositor(GetViewport(), "RenderHDRScene");
		mSceneRenderCompositor->addListener(new VolumetricLightListener());
		Ogre::CompositorManager::getSingleton().setCompositorEnabled(GetViewport(), "RenderHDRScene", true);
		Ogre::CompositorInstance *hdrinstance = Ogre::CompositorManager::getSingleton().addCompositor(Main::Instance().GetViewport(), "DownsampleHDR1");
		HDRListener *hdrListener = new HDRListener(); 
		hdrinstance->addListener(hdrListener);
		hdrListener->notifyViewportSize(mViewport->getActualWidth(), mViewport->getActualHeight());
		hdrListener->notifyCompositor(hdrinstance);
		Ogre::CompositorManager::getSingleton().setCompositorEnabled(GetViewport(), "DownsampleHDR1", true);
	}