History

CHanging the lighting BUffer format and adding tone mapping

Sam Cake committed 10 years ago

Commit 9faec321 parent 9ddc3c214 files · +120 −47Browse files

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

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+3−3
@@ -53,7 +53,7 @@ void FramebufferCache::createPrimaryFramebuffer() { · 52 unmodified lines
5353 _deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
5454 _deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
5555
56− auto colorFormat = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
56+ auto colorFormat = gpu::Element::COLOR_RGBA_32;
5757 auto width = _frameBufferSize.width();
5858 auto height = _frameBufferSize.height();
5959
@@ -87,8 +87,8 @@ void FramebufferCache::createPrimaryFramebuffer() { · 27 unmodified lines
8787 auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler));
8888 _selfieFramebuffer->setRenderBuffer(0, tex);
8989
90− _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), width, height, defaultSampler));
91− //_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::SRGBA), width, height, defaultSampler));
90+ //_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, defaultSampler));
91+ _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::R11G11B10), width, height, defaultSampler));
9292 // _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
9393 _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
9494 _lightingFramebuffer->setRenderBuffer(0, _lightingTexture);