History

Adding acleaner way to do all the deferred frame transform manipulation

samcake committed 10 years ago

Commit 0ea1e7c1 parent a22de7615 files · +644 −2Browse files

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

Unified · Split

libraries/render-utils/src/FramebufferCache.cpp+22−0
@@ -111,6 +111,13 @@ void FramebufferCache::createPrimaryFramebuffer() { · 110 unmodified lines
111 _depthPyramidFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);111 _depthPyramidFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
112 112
113 113
114
115 _curvatureTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
116 _curvatureFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
117 _curvatureFramebuffer->setRenderBuffer(0, _curvatureTexture);
118 _curvatureFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
119
120
114 resizeAmbientOcclusionBuffers();121 resizeAmbientOcclusionBuffers();
115}122}
116 123
@@ -245,6 +252,21 @@ gpu::TexturePointer FramebufferCache::getDepthPyramidTexture() { · 128 unmodified lines
245 return _depthPyramidTexture;252 return _depthPyramidTexture;
246}253}
247 254
255gpu::FramebufferPointer FramebufferCache::getCurvatureFramebuffer() {
256 if (!_curvatureFramebuffer) {
257 createPrimaryFramebuffer();
258 }
259 return _curvatureFramebuffer;
260}
261
262gpu::TexturePointer FramebufferCache::getCurvatureTexture() {
263 if (!_curvatureTexture) {
264 createPrimaryFramebuffer();
265 }
266 return _curvatureTexture;
267}
268
269
248void FramebufferCache::setAmbientOcclusionResolutionLevel(int level) {270void FramebufferCache::setAmbientOcclusionResolutionLevel(int level) {
249 const int MAX_AO_RESOLUTION_LEVEL = 4;271 const int MAX_AO_RESOLUTION_LEVEL = 4;
250 level = std::max(0, std::min(level, MAX_AO_RESOLUTION_LEVEL));272 level = std::max(0, std::min(level, MAX_AO_RESOLUTION_LEVEL));