last day (20 days later) » 

3:12 PM
0
A: Bloom effect using downscaling (downsampling) technique using OpenGL/GLSL

PodgorskiyYou may use textureLod, as BDL suggested, but I think that there is no real need for this. Once the required mipmap levels are generated, the right level will be selected automatically depending on the size of the active render buffer. The main idea of the article you have mentioned, is that they...

 
Thanks for your response. Let's take an example: the bright pass texture format is 1024x720. Let's try to recover the mipmap level 3 (128x90). Like you said I just have to create a FBO and RBO + texture attached to it (so the color texture and the RBO are initialized with the dimension 128x90). So when I execute my bluring pass I apply the gaussian blur algorithm on a 128x90 bright texture (mipmap level 3). But the problem is I need to blur a 1024x720 texture(the max precision). So I think the right solution is like you say to use the function textureLod in the fragment shader. Are you agree?
I think I need to re-scale the low level texture to higher level but keeping the low resolution (128x90 -> 1024x720) before applying blur effect. I thought an intermediate render pass with in input the bright render pass texture and recover my 4 downscaled bright textures. Next all I need to do is to bind them separatly within the bluring pass. Like my FBO (the one into the bluring pass) is scaled in 1024x720 the blur algorithm will be applied this time on a 1024x720 low level texture. What do you think about this ?
But I think the function textureLod should avoid the intermediate render passes and directly into the bluring pass selecting the right level of mipmap in my fragment shader.
 
@user1364743, you said: Let's take an example: the bright pass texture format is 1024x720. Let's try to recover the mipmap level 3 (128x90). Like you said I just have to create a FBO and RBO + texture attached to it (so the color texture and the RBO are initialized with the dimension 128x90). So when I execute my bluring pass I apply the gaussian blur algorithm on a 128x90 bright texture (mipmap level 3). You are absolutelly right. You do not need to perform blur at the max resolution.
There is just no sense in it. Blurring of downscaled image is not so costly as blurring original image, while the result is almost the same.
More over, in the article, they mentioned that several images were used, that have different downscale rate. This allows using the same blurring kernel and get different blurring radiuses.
You downscale image and you lost some amount of details, and it is just what needed. Then, if you process the blurring step in upscaled resolution, or perform blurring step at the resolution of downscaled image, the result would be the same.
 
Hello
Like you said I've already tried blur downsampled texture like for my example mentionned above (128x90). The problem is when I blur this texture the result is almost the same. because there is not enough pixel to sample. So that's why my solution would have been to upscale the texture to 1024x720 format keeping the low precision.
But like you said it's useless and I will have the same blur result using THE lower resolution. But you said "using the same blurring kernel and get different blurring radiuses". What is bluring radius ? You want to talk about the variance (sigma^2) ?
 
3:34 PM
Yes, when I said bluring radiues, I mean variance.
What do you mean, when you said that "there is not enough pixel to sample"?
 
So if I have a good understanding of what you said if I apply gaussian blur on the 128x90 bright texture with an other blur radius I will have the same result than in upscaled resolution (1024x720). The trick is to find the good radius value.
 
Yes, exactly.
If you use separate gaussian blurring, you should calculate the offset of the samples so, that it sample just at the centers of texels
I mean, let current texel is at index j in the row(column). The kernel should sample texels: j-n, j-1, j, j+1, j+n.
 
I mean for a same variance X if you have 2 textures with different resolutions (128x90 and 1024x720) you can't have the same blur effect in the lower resolution because you don't have the same number of pixels, so less precision. So, I'm going to test differents variances with the same convolution kernel (for instance 21x21) and see the result and the lower resolution.
 
You said that there will be less number of pixels so less pricision. But why it should be in less precision, if in case of original reolution (1024x720), you still will sample downscaled image (128x90) and the result would be linear interpolation between texels of the downscaled image?
Of course the texture attached to the frame buffer with blurred image should have linear interpolation at magnification filter, because when you apply the blurred image over the original image, you will upscale it.
 
3:56 PM
Ok! Thank you very much for all!
 
It is nothing! Tell me please, if you get something interesting from your experiments.
 
It's ok I think I'm going to post my result in response to my Question and I think we will discuss about that. So I'm going to work on it and I come back to you when it's finished! See you later!
 
Ok! See you!
 

  last day (20 days later) »