Search Unity

A solution for aliasing

Discussion in 'Film, TV, Animation & Cinematics Previews' started by GeniusKoala, May 11, 2021.

  1. GeniusKoala

    GeniusKoala

    Joined:
    Oct 13, 2017
    Posts:
    72
    Hi!

    I am currently using Unity for cartoon series productions. So far we achieved really good results but we are still lacking solution for aliasing problems.

    Our pipeline is mostly based on alembic streamed in Unity via the Alembic package (we are using it since it was in preview stage). We tried several assets on the Asset Store like Madgoat (which is not developped anymore but thanks for their developers for this asset!) or Deckard (it changed a lot the workflow and rises the rendering time significantly).

    We tried the supersampling option in the Unity Recorder (via the Timeline) but it only works for the same rendering and output resolution. It only works for 1080p -> 1080p but not 4K -> 1080p for example. With the supersampling grid set to X16, the results are already better but it's not enough for TV shows productions.

    Now I tried the "Cinematic Studio Sample" with has really smooth renders. I can't even see any aliasing at any moment. You really did an amazing short there! I was curious to know how you achieve this result and I saw you only use FXAA for the anti-aliasing haha.

    Is there guides to prevent from aliasing for film productions ? Or techniques maybe like supersampling ? If yes how can I achieve to get smoother results. We don't aim realtime rendering. For example we render frames in 3sec, we can afford to render it in 10-15sec.

    Thanks for opening this thread about Film production since I've never known how to address this concern!
     
    Last edited: May 11, 2021
  2. jean_unity_film_tv

    jean_unity_film_tv

    Unity Technologies

    Joined:
    Jan 31, 2018
    Posts:
    54
    Hi,
    HDRP offers a few options for anti-aliasing, FXAA, SMAA and TAA. But as you have seen none of these options are perfect.
    As you already suggested supersampling for your final image will probably give you the best AA. If you don't mind the increased rendering time and extra steps you can record images sequences at a larger resolution, for example render 4K for a 1080p production. And resize the images to create your final in another application.
    Regards,
    Jean
     
    GeniusKoala likes this.
  3. GeniusKoala

    GeniusKoala

    Joined:
    Oct 13, 2017
    Posts:
    72
    Extra steps are not really a solution since we are a small team and can't afford to make the pipeline more complex. All our productions are for 1080p so far. The best would be to export rescaled images from Unity already. That's why I tested the texture sampling recorder first but since it does not work I tested Madgoat and Deckard. Madgoat was quite the solution but is not supported anymore since the studio stopped to develop it. It could increase the resolution scale and apply anti-aliasing with some options. I know in URP we can increase the resolution scale from the URP Asset but in HDRP I don't know how to do that. Dynamic resolution don't let me go further 100 so it's not a solution I guess. I saw there is an API now that may help but I'm not sure I guess it's just for path traced accumulation needs : https://docs.unity3d.com/Packages/c...high-definition@10.2/manual/Accumulation.html

    I hoped the Recorder package could do the supersampling correctly. It would be transparent for the users since we could work in 1080p et just export 4K -> 1080p rendered images.

    Otherwise if there are guides or documentation I am not aware about, I'm opened to see how to implement a custom supersampling recorder with custom anti-aliasing.

    Plus I guess since we use alembic we can't use TAA because it creates a lot of ghosting and make our characters super noisy. I could share in private some videos if you want to see what we work on.

    Thank you!
     
    Last edited: May 12, 2021
  4. kemny3d

    kemny3d

    Joined:
    Nov 5, 2018
    Posts:
    2
    https://forum.unity.com/threads/cinematic-studio-sample-details-and-documentation.1100941/ Hey, try turning on accumulation as explained in the pdf attached there (page 24) it will give really smooth results and average out artifacts, ghosting and aliasing. I recommend rendering to a png sequence. As a lightweight external step, you can use ffmpeg to convert the pngs to video and downscale at the same time on the commandline (something like ffmpeg -i frames.####.png -scale 1080:-1 -crf 10 output.mp4)
     
    GeniusKoala likes this.
  5. aaronc_unity

    aaronc_unity

    Unity Technologies

    Joined:
    Jan 24, 2019
    Posts:
    2
    Hi GeniusKoala,

    I recommend using Multisample anti-aliasing (MSAA) to achieve smoother results without any extra effort. Here's how to enable it:
    1. Determine where your default HDRP asset is located: in the menu bar, click Edit > Project Settings > Quality
    2. Click on the asset in the Rendering field to locate it in the Project pane
    3. In the Inspector, change Lit Shader Mode to Forward only, and set Multisample anti-alisaing to MSAA 8x
    4. Enable MSAA in the default frame settings: Edit > Project Settings > HDRP Default Settings
      • Locate Default Frame Settings for Camera
      • Enable MSAA Within Forward
    You can also mix MSAA with other types of anti-aliasing on the camera to find the result that works best.

    More details on configuring your HDRP asset here:
    https://docs.unity3d.com/Packages/c...s.high-definition@12.0/manual/HDRP-Asset.html


    Hope that helps!
     

    Attached Files:

    Last edited: May 14, 2021
    GeniusKoala likes this.
  6. aaronc_unity

    aaronc_unity

    Unity Technologies

    Joined:
    Jan 24, 2019
    Posts:
    2
    FYI there's one more step once you've got MSAA configured on the HDRP asset, which I've added in my previous post for clarity.
     
    GeniusKoala likes this.
  7. GeniusKoala

    GeniusKoala

    Joined:
    Oct 13, 2017
    Posts:
    72
    MSAA is really a helper but it does not answer to all the problems like those due to rim lights, increasing the resolution scale would definitely help more but this feature is only for URP. Plus MSAA is not supported with raytracing enabled yet. I will try accumulation. Does it work with every type of AA? (when we use TAA we loose MSAA for example)
     
  8. kemny3d

    kemny3d

    Joined:
    Nov 5, 2018
    Posts:
    2
    Accumulation should work with any AA I think -- all it's doing is taking subframe renders and then averaging them together for the frame render. (If turning it on like the pdf doesn't seem to do anything let me know, you used to have to also add a setting in your project settings, but it may have changed) But raytracing only supports TAA.
     
    GeniusKoala likes this.
  9. GeniusKoala

    GeniusKoala

    Joined:
    Oct 13, 2017
    Posts:
    72
    Thanks for the tip but unfortunatly accumulation does not help for the aliasing. I'm out of ideas. I think render scale would be the only solution there is no option for HDRP :(

    I can't use raytracing too because MSAA is not supported and MSAA is really a helper to smoother the renders. I'm stuck with no raytracing and no render scale.
     
  10. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    62
    I was having this issue as well. Especially with trying to get RTX and MSAA working nicely for certain situations. If you are using RTX then I am assuming you have an nvidia Card?

    Please note I am using the beta, not the release version.

    I am starting to see some results with:
    Recorder using accumulation (anything over 8 samples but have been settling on around 16 just now for RTX)
    Nvidia DLSS on - maximum quality, optimal settings unchecked, and sharpness around 0.75. Make sure this is on in the project settings and camera.
    I have the fall back as TAA with (0.4 / 0.1 0 / 0.3 / anti ringing
     
    newguy123 and GeniusKoala like this.
unityunity