Two Pass Filtering? What's the 1st pass result?

I have a filter shader that is separable, and I’d like to break it into an H and V pass. Obviously, the first pass - let’s say the horizontal filtering needs to go into a texture to be used in the 2nd pass, then the 2nd pass uses the new texture.

My question is, do I draw the whole scene, or just another version of the same texture, at the filtered size?

I guess it has to change size - that’s the point of the filtering, and that implies possibly changing shape, so it would be the size and shape it will be in the final product. So should the product of the 1st pass look like that single texture, but shaped as it will be in the final product, or will/should the 1st pass be the complete scene? Does that cause alpha problems, or does the second pass just ignore depth and alpha?

It’s scaling, btw, so I’d have to do 16 fetches per fragment, versus doing 4 per fragment on the H pass, and 4 on the V pass.

Bruce

You seem to be completely confused.
During filtering, you generally don’t draw your scene at all.
A typical scenario:
Scene->Tex0 (rendering)
Tex0->Tex1 (filter-horisontal)
Tex1->Screen (filter-vertical)

Well, I am confused, for sure.

The purpose of the filter is to scale the texture (bicubic filtering). So the first pass must be at the desired size, or else it won’t even have the correct amount of samples to use in the second pass, will it? Or at least, the h sampling wouldn’t be correct.

BTW, this may be somewhat academic - I’m going to try the technique in GPU Gems 3 to use linear filtered samples in the h direction (halve the number of samples) and then do v filtering as before (I can’t do both this way, since I have to treat interlaced video differently).

Bruce

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.