Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 908 vs 909 for /trunk/Source Code/Rendering/PostFX/CustomOperators/SSAOPreRenderOperator.cpp

Diff revisions: vs.
  @@ -16,9 +16,9 @@
16 16 SSAOPreRenderOperator::SSAOPreRenderOperator(GFXDevice& context, PreRenderBatch& parent, ResourceCache& cache)
17 17 : PreRenderOperator(context, parent, cache, FilterType::FILTER_SS_AMBIENT_OCCLUSION)
18 18 {
19 -
20 - _samplerCopy = _context.allocateRT("SSAO");
21 - _samplerCopy._rt->addAttachment(parent.inputRT().getDescriptor(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
19 + _samplerCopy = _context.allocateRT(vec2<U16>(parent.inputRT().getWidth(), parent.inputRT().getHeight()), "SSAO");
20 + _samplerCopy._rt->addAttachment(parent.inputRT().getAttachment(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
21 + _samplerCopy._rt->create();
22 22
23 23 U16 ssaoNoiseSize = 4;
24 24 U16 noiseDataSize = ssaoNoiseSize * ssaoNoiseSize;
  @@ -69,7 +69,9 @@
69 69 screenSampler.setFilters(TextureFilter::LINEAR);
70 70 screenSampler.setAnisotropy(0);
71 71
72 - _ssaoOutput = _context.allocateRT("SSAO_Out");
72 + vec2<U16> res(parent.inputRT().getWidth(), parent.inputRT().getHeight());
73 +
74 + _ssaoOutput = _context.allocateRT(res, "SSAO_Out");
73 75 TextureDescriptor outputDescriptor(TextureType::TEXTURE_2D,
74 76 GFXImageFormat::RED16,
75 77 GFXDataFormat::FLOAT_16);
  @@ -78,7 +80,7 @@
78 80 //Colour0 holds the AO texture
79 81 _ssaoOutput._rt->addAttachment(outputDescriptor, RTAttachment::Type::Colour, 0);
80 82
81 - _ssaoOutputBlurred = _context.allocateRT("SSAO_Blurred_Out");
83 + _ssaoOutputBlurred = _context.allocateRT(res, "SSAO_Blurred_Out");
82 84 _ssaoOutputBlurred._rt->addAttachment(outputDescriptor, RTAttachment::Type::Colour, 0);
83 85
84 86 ResourceDescriptor ssaoGenerate("SSAOPass.SSAOCalc");
  @@ -111,8 +113,8 @@
111 113 void SSAOPreRenderOperator::reshape(U16 width, U16 height) {
112 114 PreRenderOperator::reshape(width, height);
113 115
114 - _ssaoOutput._rt->create(width, height);
115 - _ssaoOutputBlurred._rt->create(width, height);
116 + _ssaoOutput._rt->resize(width, height);
117 + _ssaoOutputBlurred._rt->resize(width, height);
116 118
117 119 _ssaoGenerateShader->Uniform("noiseScale", vec2<F32>(width, height) / to_F32(_noiseTexture->getWidth()));
118 120 _ssaoBlurShader->Uniform("ssaoTexelSize", vec2<F32>(1.0f / _ssaoOutput._rt->getWidth(),