Beginning impementation of CGizmo; loading assets + rendering are implemented as well as toggling modes and scaling it on the UI (plus minor renderer bug fixes)

This commit is contained in:
parax0
2015-08-16 00:29:37 -04:00
parent 084ddeadee
commit 44d0900125
11 changed files with 501 additions and 11 deletions

View File

@@ -125,6 +125,7 @@ void CRenderer::SetViewportSize(u32 Width, u32 Height)
void CRenderer::RenderBuckets(CCamera& Camera)
{
if (!mInitialized) Init();
mSceneFramebuffer.Bind();
// Set backface culling
if (mOptions & eEnableBackfaceCull) glEnable(GL_CULL_FACE);
@@ -141,6 +142,7 @@ void CRenderer::RenderBuckets(CCamera& Camera)
mTransparentBucket.Clear();
// Clear depth buffer to enable more rendering passes
glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT);
}
@@ -172,6 +174,7 @@ void CRenderer::RenderBloom()
glViewport(0, 0, BloomWidth, BloomHeight);
glClearColor(0.f, 0.f, 0.f, 0.f);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_FALSE);
CGraphics::SetIdentityMVP();
CGraphics::UpdateMVPBlock();
@@ -308,10 +311,6 @@ void CRenderer::BeginFrame()
void CRenderer::EndFrame()
{
// Post-processing
if (mBloomMode != eNoBloom)
RenderBloom();
// Render result to screen
glBindFramebuffer(GL_FRAMEBUFFER, mDefaultFramebuffer);
InitFramebuffer();

View File

@@ -13,8 +13,8 @@ public:
IRenderable() {}
virtual ~IRenderable() {}
virtual void AddToRenderer(CRenderer *pRenderer) = 0;
virtual void Draw(ERenderOptions options) = 0;
virtual void DrawAsset(ERenderOptions, u32) {}
virtual void Draw(ERenderOptions options) {}
virtual void DrawAsset(ERenderOptions options, u32 asset) {}
virtual void DrawSelection() {}
};