Jump to content

How to make TAA not applying on Auxiliary


photo

Recommended Posts

Hi, we have some cool effects such as Outline, Highlight, Border Detection... in post shaders that require auxiliary buffer. We now need combining these effects at the same time but we only have one auxiliary texture so we tried to set alpha channel like a kind of mask for each effect/object combination (like viewport mask). Shaders will check alpha channel of auxiliary buffer and if it does match their 'mask', they will make the effect using auxiliary RGB channels.

When 'masks' fit the effect works fine, but when they do not, some artifacts can be seen. After investigating we realized that TAA is been applied on Auxiliary buffer and, consecuently, blending alpha channel with old auxiliary that is what makes this artifacts. Is there any way to make TAA not being applied on Auxiliary buffer? Is there any way to check old/current auxiliary buffer before applying TAA? Maybe any other tip to achieve this 'mask' behaviour?

Thanks in advance, Javier

 

[Mask not matching and TAA active. Orange is Outline effect and Green is Highlight effect]

flickering.gif.16ffef9da91dfa3a8bd342b1d72e5e98.gif

[Mask matching and TAA active]

ok.gif.fc79b40fcc7689f2256d4e5758d7b26d.gif

Link to comment

Unfortunately TAA is a global setting (at least as late as where I'm checking in 2.6.1) based on the console setting render_antialising but perhaps you can temporarily disable it with Render::addCallback() at the CALLBACK_BEGIN_AUXILIARY_BUFFER and CALLBACK_END_AUXILIARY_BUFFER stages?

Link to comment

Hi, I'll try this as soon as I can.

When looking at 2.7 USC documentation, I couldn't find engine.render.addCallback(), engine.render.removeCallback() and engine.render.clearCallbacks(). Are callbacks only accesible from C++ API ?

Thanks for your help, Javier

Edited by javier.serrano
Link to comment

Hi Javier,

There's one trick you can try in order to disable TAA for auxiliary buffer. It's a hacky workaround but still might work in your case.

The idea is add two callbacks: CALLBACK_BEGIN_AUXILIARY_BUFFER where you disable TAA by calling Render::get()->setTAA(0) and CALLBACK_END_AUXILIARY_BUFFER where you enable it back.

Link to comment
×
×
  • Create New...