History

Introducing a new technique for normal packing and fixing a bug on the normal buffer format

samcake committed 10 years ago

Commit 1dca62f1 parent ae7d8175 files · +109 −41Browse files

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

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+3−2
@@ -59,8 +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;
6362 auto colorFormat = gpu::Element::COLOR_SRGBA_32;
63+ auto linearFormat = gpu::Element::COLOR_RGBA_32;
6464 auto width = _frameBufferSize.width();
6565 auto height = _frameBufferSize.height();
6666
@@ -70,7 +70,8 @@ void FramebufferCache::createPrimaryFramebuffer() { · 3 unmodified lines
7070 _primaryFramebuffer->setRenderBuffer(0, _primaryColorTexture);
7171
7272 _deferredColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));
73− _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));
73+
74+ _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(linearFormat, width, height, defaultSampler));
7475 _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));
7576
7677 _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture);