History

Defaulting the color formats used in the rendering pipeline to sRGB

samcake committed 10 years ago

Commit d5a9d391 parent d656f612 files · +5 −5Browse files

Showing the changes to libraries/render-utils/src/FramebufferCache.cpp (1 of 2 files). Show all

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+3−5
@@ -59,7 +59,8 @@ void FramebufferCache::createPrimaryFramebuffer() { · 58 unmodified lines
5959 _deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
6060 _deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
6161
62− auto colorFormat = gpu::Element::COLOR_RGBA_32;
62+ // auto colorFormat = gpu::Element::COLOR_RGBA_32;
63+ auto colorFormat = gpu::Element::COLOR_SRGBA_32;
6364 auto width = _frameBufferSize.width();
6465 auto height = _frameBufferSize.height();
6566
@@ -95,10 +96,7 @@ void FramebufferCache::createPrimaryFramebuffer() { · 29 unmodified lines
9596
9697 auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR);
9798
98− // FIXME: Decide on the proper one, let s stick to R11G11B10 for now
99− //_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, defaultSampler));
10099 _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler));
101− //_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
102100 _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
103101 _lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
104102 _lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
@@ -212,7 +210,7 @@ gpu::TexturePointer FramebufferCache::getLightingTexture() { · 107 unmodified lines
212210
213211 gpu::FramebufferPointer FramebufferCache::getFramebuffer() {
214212 if (_cachedFramebuffers.isEmpty()) {
215− _cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_RGBA_32, _frameBufferSize.width(), _frameBufferSize.height())));
213+ _cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_SRGBA_32, _frameBufferSize.width(), _frameBufferSize.height())));
216214 }
217215 gpu::FramebufferPointer result = _cachedFramebuffers.front();
218216 _cachedFramebuffers.pop_front();