Fixed HDR controls for multiple atm's.

This commit is contained in:
Jonathas Costa
2017-07-11 14:52:59 -04:00
parent 18d8612a8a
commit 39b90863d6
11 changed files with 107 additions and 117 deletions

View File

@@ -65,6 +65,9 @@ ABufferRenderer::ABufferRenderer()
, _dirtyRendererData(true)
, _dirtyResolveDictionary(true)
, _resolveProgram(nullptr)
, _hdrExposure(0.4)
, _hdrBackground(2.8)
, _gamma(2.2)
{}
ABufferRenderer::~ABufferRenderer() {}
@@ -406,6 +409,27 @@ void ABufferRenderer::setHDRExposure(const float hdrExposure) {
}
}
void ABufferRenderer::setHDRBackground(const float hdrBackground) {
_hdrBackground = hdrBackground;
if (_hdrBackground < 0.0) {
LERROR("HDR Background constant must be greater than zero.");
_hdrBackground = 1.0;
}
}
void ABufferRenderer::setGamma(const float gamma) {
_gamma = gamma;
if (_gamma < 0.0) {
LERROR("Gamma value must be greater than zero.");
_gamma = 2.2;
}
}
float ABufferRenderer::hdrBackground() const {
return _hdrBackground;
}
void ABufferRenderer::clear() {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _anchorPointerTextureInitializer);
glBindTexture(GL_TEXTURE_2D, _anchorPointerTexture);