Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TAA not applying to specific GameObject

Discussion in 'High Definition Render Pipeline' started by yzhao105, Jul 28, 2021.

  1. yzhao105

    yzhao105

    Joined:
    Sep 15, 2017
    Posts:
    28
    I created a volumetric sandstorm in hdrp, but the cost is too high when every pixel is raymarched. So I used compute shader to render a low resolution texture first and then sample that texture on a quad to show the sandstorm. (I am using a quad to show the sandstorm so that the hdrp fog could be applied correctly.)

    But I ran into a weird issue. When I am not using compute shader, and raymarch the sandstorm directly on a quad, TAA helps a lot with blurring out some of the artifacts. But when I use the compute shader to calculate a render texture first, TAA does not seem to have any effect. The quads are identical; the algorithm for raymarching the sandstorm is identical; when TAA is turned off, the look of the sandstorms are identical; only when TAA is turned on, the quad without sampling render texture produced by compute shader shows significant improvement on visuals.

    I have checked the frame debugger, which is very much the same for these two versions. I didn't spot anything suspicious.

    Anyone has any idea what could've caused this? Thanks.
     
  2. yzhao105

    yzhao105

    Joined:
    Sep 15, 2017
    Posts:
    28
    So, after some investigation, I suspect the problem comes from the quad not waiting for compute shader to finish rendering the texture. Therefore, the quad is actually still sampling the render texture calculated last frame. And thus there is no difference between current and last frames, which makes TAA not effective.

    Anyone knows how to force the material on the quad to wait for compute shader to finish the render texture? Thanks.
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,848
    if you dispatch the compute shader right a t the beginning of the frame it should be ready when it comes to render tansparents. most likely the gpu will not even start rendering until compute has finished.
     
    yzhao105 likes this.
  4. yzhao105

    yzhao105

    Joined:
    Sep 15, 2017
    Posts:
    28
    I did some testing and made sure the compute shader actually gets finished first. But TAA is still not effective. So I used mipmap to blur it instead of depending on TAA.

    Still quite confused on why TAA is not effective.