Showing the changes to libraries/render-utils/src/DeferredFramebuffer.cpp (1 of 7 files). Show all
Unified · Split
| @@ -54,9 +54,11 @@ void DeferredFramebuffer::allocate() { · 53 unmodified lines | |||
| 54 | auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_POINT); | 54 | auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_POINT); |
| 55 | 55 | ||
| 56 | _deferredColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); | 56 | _deferredColorTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); |
| 57 | 57 | _deferredColorTexture->setSource("DeferredFramebuffer::_deferredColorTexture"); | |
| 58 | _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(linearFormat, width, height, defaultSampler)); | 58 | _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(linearFormat, width, height, defaultSampler)); |
| 59 | _deferredNormalTexture->setSource("DeferredFramebuffer::_deferredNormalTexture"); | ||
| 59 | _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); | 60 | _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width, height, defaultSampler)); |
| 61 | _deferredSpecularTexture->setSource("DeferredFramebuffer::_deferredSpecularTexture"); | ||
| 60 | 62 | ||
| 61 | _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture); | 63 | _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture); |
| 62 | _deferredFramebuffer->setRenderBuffer(1, _deferredNormalTexture); | 64 | _deferredFramebuffer->setRenderBuffer(1, _deferredNormalTexture); |
| @@ -67,6 +69,7 @@ void DeferredFramebuffer::allocate() { · 4 unmodified lines | |||
| 67 | auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format | 69 | auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format |
| 68 | if (!_primaryDepthTexture) { | 70 | if (!_primaryDepthTexture) { |
| 69 | _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler)); | 71 | _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler)); |
| 72 | _primaryDepthTexture->setSource("DeferredFramebuffer::_primaryDepthTexture"); | ||
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | _deferredFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | 75 | _deferredFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| @@ -77,6 +80,7 @@ void DeferredFramebuffer::allocate() { · 4 unmodified lines | |||
| 77 | auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR); | 80 | auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR); |
| 78 | 81 | ||
| 79 | _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler)); | 82 | _lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler)); |
| 83 | _lightingTexture->setSource("DeferredFramebuffer::_lightingTexture"); | ||
| 80 | _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); | 84 | _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 81 | _lightingFramebuffer->setRenderBuffer(0, _lightingTexture); | 85 | _lightingFramebuffer->setRenderBuffer(0, _lightingTexture); |
| 82 | _lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); | 86 | _lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |