Showing the changes to libraries/render-utils/src/FramebufferCache.cpp (1 of 23 files). Show all
Unified · Split
| @@ -33,7 +33,7 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 32 unmodified lines | ||
| 33 | 33 | //If the size changed, we need to delete our FBOs |
| 34 | 34 | if (_frameBufferSize != frameBufferSize) { |
| 35 | 35 | _frameBufferSize = frameBufferSize; |
| 36 | − _primaryFramebuffer.reset(); | |
| 36 | + /* _primaryFramebuffer.reset(); | |
| 37 | 37 | _primaryDepthTexture.reset(); |
| 38 | 38 | _primaryColorTexture.reset(); |
| 39 | 39 | _deferredFramebuffer.reset(); |
| @@ -41,11 +41,11 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 1 unmodified line | ||
| 41 | 41 | _deferredColorTexture.reset(); |
| 42 | 42 | _deferredNormalTexture.reset(); |
| 43 | 43 | _deferredSpecularTexture.reset(); |
| 44 | − _selfieFramebuffer.reset(); | |
| 44 | + */ _selfieFramebuffer.reset(); | |
| 45 | 45 | _cachedFramebuffers.clear(); |
| 46 | − _lightingTexture.reset(); | |
| 46 | + /* _lightingTexture.reset(); | |
| 47 | 47 | _lightingFramebuffer.reset(); |
| 48 | − _depthPyramidFramebuffer.reset(); | |
| 48 | + */ _depthPyramidFramebuffer.reset(); | |
| 49 | 49 | _depthPyramidTexture.reset(); |
| 50 | 50 | _curvatureFramebuffer.reset(); |
| 51 | 51 | _curvatureTexture.reset(); |
| @@ -57,17 +57,17 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 5 unmodified lines | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | void FramebufferCache::createPrimaryFramebuffer() { |
| 60 | − _primaryFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); | |
| 60 | + /* _primaryFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); | |
| 61 | 61 | _deferredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 62 | 62 | _deferredFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 63 | − | |
| 63 | + */ | |
| 64 | 64 | auto colorFormat = gpu::Element::COLOR_SRGBA_32; |
| 65 | 65 | auto linearFormat = gpu::Element::COLOR_RGBA_32; |
| 66 | 66 | auto width = _frameBufferSize.width(); |
| 67 | 67 | auto height = _frameBufferSize.height(); |
| 68 | 68 | |
| 69 | 69 | auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_POINT); |
| 70 | − _primaryColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); | |
| 70 | + /* _primaryColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); | |
| 71 | 71 | |
| 72 | 72 | _primaryFramebuffer->setRenderBuffer(0, _primaryColorTexture); |
| 73 | 73 | |
| @@ -81,10 +81,10 @@ void FramebufferCache::createPrimaryFramebuffer() { · 7 unmodified lines | ||
| 81 | 81 | _deferredFramebuffer->setRenderBuffer(2, _deferredSpecularTexture); |
| 82 | 82 | |
| 83 | 83 | _deferredFramebufferDepthColor->setRenderBuffer(0, _deferredColorTexture); |
| 84 | − | |
| 84 | + */ | |
| 85 | 85 | // auto depthFormat = gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::DEPTH); |
| 86 | 86 | auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format |
| 87 | − _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler)); | |
| 87 | +/* _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler)); | |
| 88 | 88 | |
| 89 | 89 | _primaryFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| 90 | 90 | |
| @@ -92,31 +92,31 @@ void FramebufferCache::createPrimaryFramebuffer() { · 1 unmodified line | ||
| 92 | 92 | |
| 93 | 93 | _deferredFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| 94 | 94 | |
| 95 | − | |
| 95 | +*/ | |
| 96 | 96 | _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 97 | 97 | auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler)); |
| 98 | 98 | _selfieFramebuffer->setRenderBuffer(0, tex); |
| 99 | 99 | |
| 100 | 100 | auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR); |
| 101 | 101 | |
| 102 | − _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler)); | |
| 102 | + /* _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler)); | |
| 103 | 103 | _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 104 | 104 | _lightingFramebuffer->setRenderBuffer(0, _lightingTexture); |
| 105 | 105 | _lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| 106 | 106 | |
| 107 | 107 | _deferredFramebuffer->setRenderBuffer(3, _lightingTexture); |
| 108 | − | |
| 108 | + */ | |
| 109 | 109 | // For AO: |
| 110 | 110 | auto pointMipSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_POINT); |
| 111 | 111 | _depthPyramidTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::RGB), width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT))); |
| 112 | 112 | _depthPyramidFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 113 | 113 | _depthPyramidFramebuffer->setRenderBuffer(0, _depthPyramidTexture); |
| 114 | − _depthPyramidFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 114 | + // _depthPyramidFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 115 | 115 | |
| 116 | 116 | _curvatureTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT))); |
| 117 | 117 | _curvatureFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 118 | 118 | _curvatureFramebuffer->setRenderBuffer(0, _curvatureTexture); |
| 119 | − _curvatureFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 119 | + // _curvatureFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 120 | 120 | |
| 121 | 121 | resizeAmbientOcclusionBuffers(); |
| 122 | 122 | } |
| @@ -138,14 +138,14 @@ void FramebufferCache::resizeAmbientOcclusionBuffers() { · 15 unmodified lines | ||
| 138 | 138 | _occlusionTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); |
| 139 | 139 | _occlusionFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 140 | 140 | _occlusionFramebuffer->setRenderBuffer(0, _occlusionTexture); |
| 141 | − _occlusionFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 141 | + // _occlusionFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 142 | 142 | |
| 143 | 143 | _occlusionBlurredTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); |
| 144 | 144 | _occlusionBlurredFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 145 | 145 | _occlusionBlurredFramebuffer->setRenderBuffer(0, _occlusionBlurredTexture); |
| 146 | − _occlusionBlurredFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 146 | + // _occlusionBlurredFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | |
| 147 | 147 | } |
| 148 | − | |
| 148 | +/* | |
| 149 | 149 | gpu::FramebufferPointer FramebufferCache::getPrimaryFramebuffer() { |
| 150 | 150 | if (!_primaryFramebuffer) { |
| 151 | 151 | createPrimaryFramebuffer(); |
| @@ -214,7 +214,7 @@ gpu::TexturePointer FramebufferCache::getLightingTexture() { · 62 unmodified lines | ||
| 214 | 214 | createPrimaryFramebuffer(); |
| 215 | 215 | } |
| 216 | 216 | return _lightingTexture; |
| 217 | −} | |
| 217 | +}*/ | |
| 218 | 218 | |
| 219 | 219 | gpu::FramebufferPointer FramebufferCache::getFramebuffer() { |
| 220 | 220 | if (_cachedFramebuffers.isEmpty()) { |