This commit is contained in:
nashmuhandes 2016-08-02 17:18:46 +08:00
commit 367baf39a2

View file

@ -76,7 +76,11 @@
// //
//========================================================================== //==========================================================================
CVAR(Bool, gl_bloom, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(Bool, gl_bloom, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR(Float, gl_bloom_amount, 1.4f, 0) CUSTOM_CVAR(Float, gl_bloom_amount, 1.4f, 0)
{
if (self < 0.1f) self = 0.1f;
}
CVAR(Float, gl_exposure, 0.0f, 0) CVAR(Float, gl_exposure, 0.0f, 0)
CUSTOM_CVAR(Int, gl_tonemap, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CUSTOM_CVAR(Int, gl_tonemap, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
@ -145,6 +149,7 @@ void FGLRenderer::BloomScene()
mBloomExtractShader->Bind(); mBloomExtractShader->Bind();
mBloomExtractShader->SceneTexture.Set(0); mBloomExtractShader->SceneTexture.Set(0);
mBloomExtractShader->Exposure.Set(mCameraExposure); mBloomExtractShader->Exposure.Set(mCameraExposure);
mVBO->BindVBO();
mVBO->RenderScreenQuad(); mVBO->RenderScreenQuad();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@ -242,6 +247,7 @@ void FGLRenderer::TonemapScene()
mTonemapShader->Bind(); mTonemapShader->Bind();
mTonemapShader->SceneTexture.Set(0); mTonemapShader->SceneTexture.Set(0);
mTonemapShader->Exposure.Set(mCameraExposure); mTonemapShader->Exposure.Set(mCameraExposure);
mVBO->BindVBO();
mVBO->RenderScreenQuad(); mVBO->RenderScreenQuad();
if (blendEnabled) if (blendEnabled)
@ -351,7 +357,8 @@ void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma)
mPresentShader->Brightness.Set(clamp<float>(vid_brightness, -0.8f, 0.8f)); mPresentShader->Brightness.Set(clamp<float>(vid_brightness, -0.8f, 0.8f));
} }
mBuffers->BindHudTexture(0); mBuffers->BindHudTexture(0);
mVBO->RenderScreenQuad(width / (float)mBuffers->GetWidth(), height / (float)mBuffers->GetHeight()); mVBO->BindVBO();
mVBO->RenderScreenQuad(mScreenViewport.width / (float)mBuffers->GetWidth(), mScreenViewport.height / (float)mBuffers->GetHeight());
if (blendEnabled) if (blendEnabled)
glEnable(GL_BLEND); glEnable(GL_BLEND);