History

FIxing the rear view mirror issue with background and fooling around with Lighting equations

samcake committed 11 years ago

Commit a2ca1c01 parent f0b76228 files · +38 −24Browse files

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

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+8−4
@@ -68,17 +68,21 @@ void FramebufferCache::createPrimaryFramebuffer() { · 67 unmodified lines
6868
6969 _primaryFramebufferStencilColor->setRenderBuffer(0, _primaryColorTexture);
7070
71− auto depthFormat = gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::DEPTH);
71+ // auto depthFormat = gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::DEPTH);
72+ auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format
7273 _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler));
7374
74− auto stencilFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format
75− _primaryStencilTexture = gpu::TexturePointer(gpu::Texture::create2D(stencilFormat, width, height, defaultSampler));
75+ // auto stencilFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format
76+ auto stencilFormat = depthFormat;
77+ // _primaryStencilTexture = gpu::TexturePointer(gpu::Texture::create2D(stencilFormat, width, height, defaultSampler));
78+ _primaryStencilTexture = _primaryDepthTexture;
7679
7780 _primaryFramebufferFull->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
7881
7982 _primaryFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
8083
81− _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);
84+ // _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);
85+ _primaryFramebufferStencilColor = _primaryFramebufferDepthColor;
8286
8387 _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
8488 auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler));