History

Putting together the stencil buffer for opaque vs background and using it for the backgroud render items

samcake committed 11 years ago

Commit 75e858c1 parent e78f15210 files · +44 −39Browse files

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

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+7−7
@@ -35,7 +35,7 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 34 unmodified lines
3535 _frameBufferSize = frameBufferSize;
3636 _primaryFramebufferFull.reset();
3737 _primaryFramebufferDepthColor.reset();
38− _primaryFramebufferDepthStencilColor.reset();
38+ _primaryFramebufferStencilColor.reset();
3939 _primaryDepthTexture.reset();
4040 _primaryStencilTexture.reset();
4141 _primaryColorTexture.reset();
@@ -49,7 +49,7 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 7 unmodified lines
4949 void FramebufferCache::createPrimaryFramebuffer() {
5050 _primaryFramebufferFull = gpu::FramebufferPointer(gpu::Framebuffer::create());
5151 _primaryFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
52− _primaryFramebufferDepthStencilColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
52+ _primaryFramebufferStencilColor = gpu::FramebufferPointer(gpu::Framebuffer::create());
5353
5454 auto colorFormat = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
5555 auto width = _frameBufferSize.width();
@@ -66,7 +66,7 @@ void FramebufferCache::createPrimaryFramebuffer() { · 10 unmodified lines
6666
6767 _primaryFramebufferDepthColor->setRenderBuffer(0, _primaryColorTexture);
6868
69− _primaryFramebufferDepthStencilColor->setRenderBuffer(0, _primaryColorTexture);
69+ _primaryFramebufferStencilColor->setRenderBuffer(0, _primaryColorTexture);
7070
7171 auto depthFormat = gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::DEPTH);
7272 _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler));
@@ -78,7 +78,7 @@ void FramebufferCache::createPrimaryFramebuffer() { · 5 unmodified lines
7878
7979 _primaryFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
8080
81− _primaryFramebufferDepthStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);
81+ _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat);
8282
8383 _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
8484 auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler));
@@ -99,11 +99,11 @@ gpu::FramebufferPointer FramebufferCache::getPrimaryFramebufferDepthColor() { · 14 unmodified lines
9999 return _primaryFramebufferDepthColor;
100100 }
101101
102−gpu::FramebufferPointer FramebufferCache::getPrimaryFramebufferDepthStencilColor() {
103− if (!_primaryFramebufferDepthStencilColor) {
102+gpu::FramebufferPointer FramebufferCache::getPrimaryFramebufferStencilColor() {
103+ if (!_primaryFramebufferStencilColor) {
104104 createPrimaryFramebuffer();
105105 }
106− return _primaryFramebufferDepthStencilColor;
106+ return _primaryFramebufferStencilColor;
107107 }
108108
109109 gpu::TexturePointer FramebufferCache::getPrimaryDepthTexture() {