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
68 68
69 _primaryFramebufferStencilColor->setRenderBuffer(0, _primaryColorTexture);69 _primaryFramebufferStencilColor->setRenderBuffer(0, _primaryColorTexture);
70 70
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
72 _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler));73 _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler));
73 74
74 auto stencilFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format75 // 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));76 auto stencilFormat = depthFormat;
77 // _primaryStencilTexture = gpu::TexturePointer(gpu::Texture::create2D(stencilFormat, width, height, defaultSampler));
78 _primaryStencilTexture = _primaryDepthTexture;
76 79
77 _primaryFramebufferFull->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);80 _primaryFramebufferFull->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
78 81
79 _primaryFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);82 _primaryFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
80 83
81 _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);84 // _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);
85 _primaryFramebufferStencilColor = _primaryFramebufferDepthColor;
82 86
83 _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());87 _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
84 auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler));88 auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler));