mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 14:12:16 +02:00
Defaulting the color formats used in the rendering pipeline to sRGB
This commit is contained in:
parent
d656f61c64
commit
d5a9d39edf
2 changed files with 5 additions and 5 deletions
|
@ -209,6 +209,8 @@ void GLBackend::resetOutputStage() {
|
||||||
_output._drawFBO = 0;
|
_output._drawFBO = 0;
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::do_setFramebuffer(Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setFramebuffer(Batch& batch, size_t paramOffset) {
|
||||||
|
|
|
@ -59,7 +59,8 @@ void FramebufferCache::createPrimaryFramebuffer() {
|
||||||
_deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
_deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
||||||
_deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
_deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
||||||
|
|
||||||
auto colorFormat = gpu::Element::COLOR_RGBA_32;
|
// auto colorFormat = gpu::Element::COLOR_RGBA_32;
|
||||||
|
auto colorFormat = gpu::Element::COLOR_SRGBA_32;
|
||||||
auto width = _frameBufferSize.width();
|
auto width = _frameBufferSize.width();
|
||||||
auto height = _frameBufferSize.height();
|
auto height = _frameBufferSize.height();
|
||||||
|
|
||||||
|
@ -95,10 +96,7 @@ void FramebufferCache::createPrimaryFramebuffer() {
|
||||||
|
|
||||||
auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR);
|
auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR);
|
||||||
|
|
||||||
// FIXME: Decide on the proper one, let s stick to R11G11B10 for now
|
|
||||||
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, defaultSampler));
|
|
||||||
_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler));
|
_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler));
|
||||||
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
|
|
||||||
_lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
_lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
||||||
_lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
|
_lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
|
||||||
_lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
|
_lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
|
||||||
|
@ -212,7 +210,7 @@ gpu::TexturePointer FramebufferCache::getLightingTexture() {
|
||||||
|
|
||||||
gpu::FramebufferPointer FramebufferCache::getFramebuffer() {
|
gpu::FramebufferPointer FramebufferCache::getFramebuffer() {
|
||||||
if (_cachedFramebuffers.isEmpty()) {
|
if (_cachedFramebuffers.isEmpty()) {
|
||||||
_cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_RGBA_32, _frameBufferSize.width(), _frameBufferSize.height())));
|
_cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_SRGBA_32, _frameBufferSize.width(), _frameBufferSize.height())));
|
||||||
}
|
}
|
||||||
gpu::FramebufferPointer result = _cachedFramebuffers.front();
|
gpu::FramebufferPointer result = _cachedFramebuffers.front();
|
||||||
_cachedFramebuffers.pop_front();
|
_cachedFramebuffers.pop_front();
|
||||||
|
|
Loading…
Reference in a new issue