Exemplo n.º 1
0
 Graphics::Graphics() : GameService("Graphics"),
     m_ActiveRenderTarget(nullptr),
     #if TARGET_OS_IPHONE
     m_MainRenderTarget(nullptr),
     #else
     m_Width(0),
     m_Height(0),
     m_ClearColor(Color::CornflowerBlueColor()),
     #endif
     m_DefaultCamera(nullptr),
     m_ActiveCamera(nullptr),
     m_ViewportWidth(0),
     m_ViewportHeight(0),
     m_BoundTextureId(0),
     m_BoundVertexArray(0)
 {
     #if TARGET_OS_IPHONE
     m_MainRenderTarget = new RenderTarget();
     SetActiveRenderTarget(m_MainRenderTarget);
     #else
     SetClearColor(m_ClearColor);
     #endif
     
     //Create the default camera and set it as the active camera
     m_DefaultCamera = new Camera();
     m_ActiveCamera = m_DefaultCamera;
 }
Exemplo n.º 2
0
void VkPostprocess::PostProcessScene(int fixedcm, const std::function<void()> &afterBloomDrawEndScene2D)
{
	auto fb = GetVulkanFrameBuffer();
	int sceneWidth = fb->GetBuffers()->GetSceneWidth();
	int sceneHeight = fb->GetBuffers()->GetSceneHeight();

	VkPPRenderState renderstate;

	hw_postprocess.exposure.Render(&renderstate, sceneWidth, sceneHeight);
	hw_postprocess.customShaders.Run(&renderstate, "beforebloom");
	hw_postprocess.bloom.RenderBloom(&renderstate, sceneWidth, sceneHeight, fixedcm);

	SetActiveRenderTarget();
	afterBloomDrawEndScene2D();

	hw_postprocess.tonemap.Render(&renderstate);
	hw_postprocess.colormap.Render(&renderstate, fixedcm);
	hw_postprocess.lens.Render(&renderstate);
	hw_postprocess.fxaa.Render(&renderstate);
	hw_postprocess.customShaders.Run(&renderstate, "scene");
}