Bloom.fx Offset Question
Posted: 01 Sep 2014, 05:21
I don't know anything of code other than just changing variables and seeing the results so my question is going to be dumb to some of you.
I am trying to learn more about graphics programming but I can't learn it just by staring at it so I have a question.
In the enbbloom.fx file there is a section of code that I think is used to sample the image and downscale it to smaller size.
Then it does this...
Here is a diagram I made to visualize what I think this is doing.
Is that code taking the original image (blue-ish color) and re sizing it to the smaller red-ish box?
Is that the size of the end texture used for bloom?
As I said, I know very little of programming and this may make no sense at all.
I am trying to learn more about graphics programming but I can't learn it just by staring at it so I have a question.
In the enbbloom.fx file there is a section of code that I think is used to sample the image and downscale it to smaller size.
Code: Select all
const float2 offset[4]=
{
float2(0.5, 0.5),
float2(0.5, -0.5),
float2(-0.5, 0.5),
float2(-0.5, -0.5)
};
Code: Select all
for (int i=0; i<4; i++)
{
bloomuv.xy=offset[i];
bloomuv.xy=(bloomuv.xy*screenfact.xy)+In.txcoord0.xy;
float4 tempbloom=tex2D(SamplerBloom1, bloomuv.xy);
bloom.xyz+=tempbloom.xyz;
}
Is that code taking the original image (blue-ish color) and re sizing it to the smaller red-ish box?
Is that the size of the end texture used for bloom?
As I said, I know very little of programming and this may make no sense at all.