Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 893 vs 909 for /trunk/Source Code/Rendering/PostFX/CustomOperators/BloomPreRenderOperator.cpp

Diff revisions: vs.
  @@ -18,15 +18,19 @@
18 18 BloomPreRenderOperator::BloomPreRenderOperator(GFXDevice& context, PreRenderBatch& parent, ResourceCache& cache)
19 19 : PreRenderOperator(context, parent, cache, FilterType::FILTER_BLOOM)
20 20 {
21 + vec2<U16> res(parent.inputRT().getWidth(), parent.inputRT().getHeight());
21 22 for (U8 i = 0; i < 2; ++i) {
22 - _bloomBlurBuffer[i] = _context.allocateRT(Util::StringFormat("Bloom_Blur_%d", i));
23 - _bloomBlurBuffer[i]._rt->addAttachment(parent.inputRT().getDescriptor(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
23 + _bloomBlurBuffer[i] = _context.allocateRT(res, Util::StringFormat("Bloom_Blur_%d", i));
24 + _bloomBlurBuffer[i]._rt->addAttachment(parent.inputRT().getAttachment(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
24 25 _bloomBlurBuffer[i]._rt->setClearColour(RTAttachment::Type::COUNT, 0, DefaultColours::BLACK());
26 + _bloomBlurBuffer[i]._rt->create();
25 27 }
26 28
27 - _bloomOutput = _context.allocateRT("Bloom");
28 - _bloomOutput._rt->addAttachment(parent.inputRT().getDescriptor(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
29 + vec2<U16> qRes(to_U16(res.w / 4.0f), to_U16(res.h / 4.0f));
30 + _bloomOutput = _context.allocateRT(qRes, "Bloom");
31 + _bloomOutput._rt->addAttachment(parent.inputRT().getAttachment(RTAttachment::Type::Colour, 0), RTAttachment::Type::Colour, 0);
29 32 _bloomOutput._rt->setClearColour(RTAttachment::Type::COUNT, 0, DefaultColours::BLACK());
33 + _bloomOutput._rt->create();
30 34
31 35 ResourceDescriptor bloomCalc("bloom.BloomCalc");
32 36 bloomCalc.setThreadedLoading(false);
  @@ -60,9 +64,9 @@
60 64
61 65 U16 w = to_U16(width / 4.0f);
62 66 U16 h = to_U16(height / 4.0f);
63 - _bloomOutput._rt->create(w, h);
64 - _bloomBlurBuffer[0]._rt->create(width, height);
65 - _bloomBlurBuffer[1]._rt->create(width, height);
67 + _bloomOutput._rt->resize(w, h);
68 + _bloomBlurBuffer[0]._rt->resize(width, height);
69 + _bloomBlurBuffer[1]._rt->resize(width, height);
66 70
67 71 _blur->Uniform("size", vec2<F32>(width, height));
68 72 }