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
59 _deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());59 _deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
60 _deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());60 _deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
61 61
62 // auto colorFormat = gpu::Element::COLOR_RGBA_32;
63 auto colorFormat = gpu::Element::COLOR_SRGBA_32;62 auto colorFormat = gpu::Element::COLOR_SRGBA_32;
63 auto linearFormat = gpu::Element::COLOR_RGBA_32;
64 auto width = _frameBufferSize.width();64 auto width = _frameBufferSize.width();
65 auto height = _frameBufferSize.height();65 auto height = _frameBufferSize.height();
66 66
@@ -70,7 +70,8 @@ void FramebufferCache::createPrimaryFramebuffer() { · 3 unmodified lines
70 _primaryFramebuffer->setRenderBuffer(0, _primaryColorTexture);70 _primaryFramebuffer->setRenderBuffer(0, _primaryColorTexture);
71 71
72 _deferredColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));72 _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));
74 _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));75 _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler));
75 76
76 _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture);77 _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture);