I’m trying to render to a texture and then apply Blur. Is it somehow possible (maybe) to prevent the ‘leak’ of the background color of the Renderer from the first pass into the next one where Blur is happening? I’ve attached the patch.
I thought that it’s maybe related to the blending options?
thank you for your reply.
It’s a nice trick, but… the gray Quad in the patch was taken for the sake of simplicity. Imagine an image applied to this Quad, then the pixels of this image will be also Chromakeyed in your solution.
wow. Thank you, it’s again a very nice trick for the background of the solid color. Using Blend with Add… But in more general case there can be an image in the background…
And I’ve noticed that the ‘RGB > ZIP > Minus > Unzip > RGB’ construct in your patch can be replaced with the Complement (Color).
this happens because Blur is operating separately on each channel, and alpha isn’t handled in any special way here
(when for this case one would expect color not mix with fully transparent regions)
blend state is disabled because otherwise it would interfere with the alpha channel of the result texture
ok, just found a clever way to fix it - and that trick only needed A16B16G16R16F texture inside
will add it to Blur module as a separate technique later
@h99: I was just trying to reduce my patch as much as possible to show the general problem. There can be many scenarios, like solid colors, images, etc. My hope was the general solution… and!
@unc: Thank you so much! The BlurAlpha works perfect. It will be great to have this technique inside the standard Blur from TextureFX, hope you have time for that.
I hit this problem, because there is an idea to make some kind of Pack which simplifies a workflow of building scenes AfterEffects-like. At a bit cost of performance a lot of things will be easier.
At the moment I’m not sure if it is the only place where the color “bleeds”, I’ll work further and will report or try to solve on my own.
sorry, I don’t get it.
May be it was my fault and I couldn’t explain clearly about “the image in the background”. What I meant is just another image lying behind the blurred one.