Subversion Repository Public Repository

Divide-Framework

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

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

Diff revisions: vs.
  @@ -19,18 +19,24 @@
19 19 : PreRenderOperator(context, parent, cache, FilterType::FILTER_BLOOM)
20 20 {
21 21 vec2<U16> res(parent.inputRT().getWidth(), parent.inputRT().getHeight());
22 - for (U8 i = 0; i < 2; ++i) {
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);
25 - _bloomBlurBuffer[i]._rt->setClearColour(RTAttachment::Type::COUNT, 0, DefaultColours::BLACK());
26 - _bloomBlurBuffer[i]._rt->create();
27 - }
28 22
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);
32 - _bloomOutput._rt->setClearColour(RTAttachment::Type::COUNT, 0, DefaultColours::BLACK());
33 - _bloomOutput._rt->create();
23 + vectorImpl<RTAttachmentDescriptor> att = {
24 + { parent.inputRT().getAttachment(RTAttachment::Type::Colour, 0).texture()->getDescriptor(), RTAttachment::Type::Colour, 0, DefaultColours::BLACK() },
25 + };
26 +
27 + RenderTargetDescriptor desc = {};
28 + desc._resolution = res;
29 + desc._attachmentCount = to_U32(att.size());
30 + desc._attachments = att.data();
31 +
32 + desc._name = "Bloom_Blur_0";
33 + _bloomBlurBuffer[0] = _context.allocateRT(desc);
34 + desc._name = "Bloom_Blur_1";
35 + _bloomBlurBuffer[1] = _context.allocateRT(desc);
36 +
37 + desc._name = "Bloom";
38 + desc._resolution = vec2<U16>(to_U16(res.w / 4.0f), to_U16(res.h / 4.0f));
39 + _bloomOutput = _context.allocateRT(desc);
34 40
35 41 ResourceDescriptor bloomCalc("bloom.BloomCalc");
36 42 bloomCalc.setThreadedLoading(false);