Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 167 vs 168 for /trunk/Source Code/Rendering/PostFX/CustomOperators/BloomPreRenderOperator.cpp

Diff revisions: vs.
  @@ -8,22 +8,23 @@
8 8
9 9 BloomPreRenderOperator::BloomPreRenderOperator(Quad3D* target,
10 10 FrameBufferObject* result,
11 - const vec2<U16>& resolution) : PreRenderOperator(BLOOM_STAGE,target,resolution),
12 - _outputFBO(result)
11 + const vec2<U16>& resolution,
12 + SamplerDescriptor* const sampler) : PreRenderOperator(BLOOM_STAGE,target,resolution,sampler),
13 + _outputFBO(result)
13 14 {
14 15 F32 width = _resolution.width;
15 16 F32 height = _resolution.height;
16 17 _tempBloomFBO = GFX_DEVICE.newFBO(FBO_2D_COLOR);
17 18
18 19 TextureDescriptor tempBloomDescriptor(TEXTURE_2D, RGBA,RGBA8,FLOAT_32);
19 - tempBloomDescriptor.setWrapMode(TEXTURE_CLAMP_TO_EDGE,TEXTURE_CLAMP_TO_EDGE);
20 - tempBloomDescriptor._generateMipMaps = false; //it's a flat texture on a full screen quad. really?
20 + tempBloomDescriptor.setSampler(*_internalSampler);
21 +
21 22 _tempBloomFBO->AddAttachment(tempBloomDescriptor,TextureDescriptor::Color0);
22 23 _tempBloomFBO->Create(width/4,height/4);
23 24
24 25 TextureDescriptor outputBloomDescriptor(TEXTURE_2D, RGBA,RGBA8,FLOAT_32);
25 - outputBloomDescriptor.setWrapMode(TEXTURE_CLAMP_TO_EDGE,TEXTURE_CLAMP_TO_EDGE);
26 - outputBloomDescriptor._generateMipMaps = false; //it's a flat texture on a full screen quad. really?
26 + outputBloomDescriptor.setSampler(*_internalSampler);
27 +
27 28 _outputFBO->AddAttachment(tempBloomDescriptor,TextureDescriptor::Color0);
28 29 _outputFBO->Create(width, height);
29 30 _bright = CreateResource<ShaderProgram>(ResourceDescriptor("bright"));
  @@ -39,9 +40,8 @@
39 40 void BloomPreRenderOperator::reshape(I32 width, I32 height){
40 41 I32 w = width/4;
41 42 I32 h = height/4;
42 - if(_tempBloomFBO){
43 + if(_tempBloomFBO)
43 44 _tempBloomFBO->Create(w,h);
44 - }
45 45 _outputFBO->Create(w, h);
46 46 }
47 47