Search Unity

Beautify! - Improve image quality producing incredibly crisp and vivid scenes

Discussion in 'Assets and Asset Store' started by Kronnect, May 3, 2016.

  1. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    That's a way to achieve it. The optimized way would be to customize Beautify so it can work in a "composing or blending mode" when rendering the UI in which it can receive the render texture you produce with the first Beautify effect and directly produce the blended image (so you don't need a third camera).
     
  2. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello, I am trying Beautify 3 antialiasing but is not completely removing jagged edges and is causing them to flicker.
    I appreciate any help with this.

    Im on Unity 2021 Built-In RP
    Thanks
     
  3. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    The anti-aliasing included in Beautify 3 is designed to run very fast, integrated in the same render pass that Beautify. The tradeoff is that it's not as powerful as TAA but it's faster and it doesn't leave ghosting, etc. Note that it works with depth buffer so only affects opaque geometry. Try reducing the intensity of the effect and make sure Depth Threshold is at least 0.001 so it only affects edges.

    Regarding the flickering, could you please send me a pm so we can discuss a repro?
     
  4. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    9
    Hello there, I have a quick question. I am using the PPSv2 version (Build-in render pipeline) and maybe I'm blind, but I could not find any improvement in Beautify 3 compared to Beautify 2 (like Anti-aliasing and Cinematic bands). I assume those features are not compatible.

    Thus I have just switched back to the build-in version, but I now realize that you can't have both LUT support AND procedural sepia with that version, is that correct? If so, that's a bummer, because it is quite handy being able to smoothly fade between our own LUTs and the sepia color...
     
    Last edited: Sep 15, 2022
  5. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    The PPSv2 version is kept for compatibility and historic reasons but the active lines are built-in and URP. I'm not sure if we can add those new features to the PPSv2 version soon.

    The procedural sepia was moved to a shader option quite time ago to reduce the number of keywords and shader variants. You can still blend between two LUT textures (ie, a custom LUT and the sepia LUT which can still be found in Beautify Resources/Textures folder) using a script and a temporary render texture and pass it to Beautify. The URP version includes a specific demo scene about LUT blending with sample code which you can adapt to the built-in version.
     
    WuceBayne likes this.
  6. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    9
    As you suggested, I'm trying to convert the LUTBlending.cs file from URP to Build-in.

    At the very end of the method "UpdateBeautifyLUT", I replaced this:
    Code (CSharp):
    1. BeautifySettings.settings.lut.Override (true);
    2. BeautifySettings.settings.lutIntensity.Override (1f);
    3. BeautifySettings.settings.lutTexture.Override (rt);
    With this:
    Code (CSharp):
    1. Beautify.instance.lutIntensity = 1f;
    2. Beautify.instance.lutTexture = ToTexture2D (rt);
    And I added the following method to convert the RenderTexture to Texture2D, since the LUT field in the Build-in version doesn't accept a RenderTexture:
    Code (CSharp):
    1. private Texture2D ToTexture2D (RenderTexture rTex) {
    2.  
    3.     Texture2D tex = new Texture2D (rTex.width, rTex.height, TextureFormat.ARGB32, false);
    4.     var old_rt = RenderTexture.active;
    5.     RenderTexture.active = rTex;
    6.  
    7.     tex.ReadPixels (new Rect (0, 0, rTex.width, rTex.height), 0, 0);
    8.     tex.Apply ();
    9.  
    10.     RenderTexture.active = old_rt;
    11.  
    12.     return tex;
    13. }
    I also imported the Lerp Shader into my project:
    inspector.png

    It works-ish, but the final render turns really dark as soon as I try to use the Phase slider to blend the two textures.

    Before using the slider:
    noblending.png

    After using the slider:
    blending.png

    Any idea?
     
    Last edited: Sep 16, 2022
  7. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
  8. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Do you have the Direct to Camera option enabled?
     
  9. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Direct to Camera is disabled. I tried it now but didn't seem to affect the view either way.
     
  10. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Are those rivers using any render feature? Try switching the order in the Universal Renderer.
     
  11. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    I checked the URP settings (below) and Beautify is the only renderer feature specified. Hopefully I understood you correctly?
    FYI I played with these settings and the ONLY thing that made the river appear was when changing "Depth Priming Mode" from "Disabled" to "Forced". Maybe this would give you a clue - I don't know what that setting is or how it would affect anything though.

    Thanks!

    renfeat.png
     
  12. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, that setting is required in order to generate the depth texture for render features in Android, iOS and WebGL. So that's the missing piece.
     
  13. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Wow - thanks. I'll give it a try! Although this is targeting PC VR... I'll still investigate though!
     
  14. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    I tried this but performance seems to suffer and there are some serious artifacts on other objects like distant trees through fog, etc. :-(
     
  15. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    I noticed Beautify 3 is out on the Asset Store. I'm really curious why we already have a new point full release, when it seems like Beautify 2 only came out a few months ago. It looks like I get a free upgrade, since I bought Beautify 2 I assume. I'm just curious why so soon?
     
    Last edited: Sep 26, 2022
  16. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Beautify 2 was released on March 2020 with URP support. You can see the initial release date on the Releases tab.
     
    Last edited: Sep 26, 2022
  17. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    Really? Oh, I see. Sorry. I guess time's slipping away from me. :oops:
     
  18. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    9
    Hello again,

    I tried to post on your forum, but it won't let me ("Forbidden. Please enable JavaScript").

    As I said in my previous post, I'm using Unity Build-in RP and I am trying to convert the LUTBlending script from your URP package.

    Since Beautify.instance.lutTexture in Unity Build-in RP doesn't accept a RenderTexture as value, I created an extension to convert RenderTexture to Texture2D:

    Code (CSharp):
    1. public static Texture2D ToTexture2D (this RenderTexture rt) {
    2.  
    3.     Texture2D tex2d = new Texture2D (rt.width, rt.height, TextureFormat.ARGB32, false, true);
    4.     tex2d.filterMode = FilterMode.Point;
    5.  
    6.     var old_rt = RenderTexture.active;
    7.     RenderTexture.active = rt;
    8.  
    9.     tex2d.ReadPixels (new Rect (0, 0, rt.width, rt.height), 0, 0);
    10.     tex2d.Apply ();
    11.  
    12.     RenderTexture.active = old_rt;
    13.  
    14.     return tex2d;
    15. }
    In LUTBlending.cs, at the very end of the UpdateBeautifyLUT method, I replaced this:

    Code (CSharp):
    1. BeautifySettings.settings.lut.Override (true);
    2. BeautifySettings.settings.lutIntensity.Override (1f);
    3. BeautifySettings.settings.lutTexture.Override (rt);
    With this:

    Code (CSharp):
    1. Beautify.instance.lutTexture = rt.ToTexture2D ();
    However, the final render turns really bad as soon as I move the Phase slider to blend two textures.

    BEFORE: https://imgur.com/a/0rejpH4
    AFTER: https://imgur.com/a/aocuEWU

    Any idea? Thanks in advance!
     
  19. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    9
    Ok I think I figured out. I updated the texture FilterMode to Bilinear and added anisoLevel in my extension method. Additionally, I replaced ReadPixels with Graphics.ConvertTexture.

    Code (CSharp):
    1. public static Texture2D ToTexture2D (this RenderTexture rt) {
    2.  
    3.     Texture2D tex2d = new Texture2D (rt.width, rt.height, TextureFormat.ARGB32, false, true);
    4.     tex2d.filterMode = FilterMode.Bilinear;
    5.     tex2d.anisoLevel = 0;
    6.  
    7.     Graphics.ConvertTexture (rt, tex2d);
    8.  
    9.     return tex2d;
    10. }
    It is now working as expected.
     
    Kronnect likes this.
  20. JakeHobbs

    JakeHobbs

    Joined:
    Mar 29, 2020
    Posts:
    9
    Hey there - I was hoping for any pointers on using Beautify in a Quest 2 build as I saw the following article on optimising the asset for the platform (https://kronnect.com/optimizing-beautify-for-oculus-quest/).

    I'm not running a particularly demanding scene currently, have a very stable 72fps at all times without Beautify, but enabling even just one effect (e.g. Saturation adjustment) absolutely tanks performance. I know post-processing is typically not compatible with the Quest 2 hardware, but thought judging by that article that it was do-able with this asset, yet I can't get it working without a huge performance hit. Have you any pointers to get better performance out of the headset with Beautify?

    BW,
    Jake
     
  21. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Are you using URP? That pipeline is not optimised for mobile in terms of post processing yet. You will get better performance with builtin pipeline on the Quest 2.
     
  22. JakeHobbs

    JakeHobbs

    Joined:
    Mar 29, 2020
    Posts:
    9
    Ah, makes sense as - yes - I'm on URP. I'm managing to push good performance out of URP currently without any PP for my use case, and am using a few of its features quite heavily. Appreciate the speedy response. Anything on your side on the roadmap to improve that, or is that just a general limitation of URP right now?

    BW,
    Jake
     
  23. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    It’s URP as of today. The new RenderGraph API coming in Unity 2023 is supposed to speed up mobile performance significantly…
     
  24. JakeHobbs

    JakeHobbs

    Joined:
    Mar 29, 2020
    Posts:
    9
    Understood. Really appreciate your responsiveness here, great to see :)
     
  25. marckv

    marckv

    Joined:
    Sep 19, 2013
    Posts:
    61
    Hi, I dont appear to have the layer mask option in Beautify, have I done something wrong?
     
  26. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Do you refer to the bloom layer mask option? Which version of Beautify are you using?
     
  27. marckv

    marckv

    Joined:
    Sep 19, 2013
    Posts:
    61
    Beautify 2 stand alone
     
  28. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    In Beautify 2 for URP, you have a "Exclude Layers" option under Bloom section.
    In Beautify 2 for built-in, the setting was called "Layer Mask".
     
  29. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,764
    Does Beautify have ambient occlusion?
     
  30. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    No. AO must be added before transparent objects while Beautify runs after both opaque and transparent objects so there’s no possible optimization integrating AO into Beautify.

    Radiant Global Illumination has a similar feature called Near Field Obscurance. This asset can be used along Beautify as well.
     
    Last edited: Feb 13, 2023
  31. SirOhwell

    SirOhwell

    Joined:
    Feb 7, 2023
    Posts:
    4
    Is there any performance difference between ver 2 and 3, when using Unity 2021 LTS and builtin pipeline? And how about webgl?
     
  32. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Not in builtin.
     
    SirOhwell likes this.
  33. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    I am helping test a project that is using Beautify 3 but its a slow process at the moment as every build Beautify recompiles 221,000 shader variants twice even though nothing has changed on the settings, is there a way to get beautify to not recompile every build as it is really slow.
     
  34. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi!

    Beautify comes with shader optimization options (stripping) which must be used to get the optimal build time and size.
    If you're using URP, the stripping options can be found at the top of the Beautify volume inspector:


    Or if you're using built-in pipeline, you can find similar options pressing the Shader Options button in the inspector:


    These options instructs Beautify to strip (avoid) compile shader features that you won't use, producing less variants during build.

    More details can be found at our Guides section:
    - URP version: https://kronnect.com/guides/beautify-urp-performance-tips/
    - Built-in pipeline version: https://kronnect.com/guides/beautify-built-in-faq/
     
  35. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    I love how the sun flare looks like, but it flickers when comes through leafs on my trees models when I am running and looking up the sky.
    Is it possible to enable sun flares smooth transition between enabled/disabled?
    It's URP 14 forward, Unity 2022.2.16
    Including gif:
    upload_2023-4-26_14-14-12.gif
     
  36. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi, yes. Check out these options under Sun Flares section to smooth the transition:

    Regards.
     
  37. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    Thanks, but with "Use Layer Mask" the obstacles are not detected using "pixels?" anymore. With this option only colliders are used as obstacle for the flare.
     
  38. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    In the URP version, for performance reasons, it's either one or other method - we'll port the technique we use in our Sun Flares HDRP asset to make the transition also smoother in the URP version without the physics requirement (new option).
     
    Nirvan likes this.
  39. Iencli

    Iencli

    Joined:
    Sep 2, 2017
    Posts:
    2
    Hello, is it possible to affect the UI with Beautify 3? For example to have bloom on the texts or sprite of the UI?

    Thank you in advance
     
  40. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Canvas rendering in world or camera space are affected. Overlay canvas render at the end of the render loop so they can’t be affected by Beautify unless you use a somewhat complex setup like two cameras and make your UI visible in the first camera and Beautify runs on the second camera.
     
    hopeful likes this.
  41. Iencli

    Iencli

    Joined:
    Sep 2, 2017
    Posts:
    2
    Thank you for your answer!
     
    Kronnect likes this.
  42. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi! Latest beta includes a whole new "Smooth" occlusion mode which performs multi-sampling and interpolation across frames based on depth buffer. You can get the beta from the support forum.
     
    Nirvan likes this.
  43. SirOhwell

    SirOhwell

    Joined:
    Feb 7, 2023
    Posts:
    4
    In documentation (urp), there is this part:
    I haven't been working with urp for long time, and not entirely sure about anything. Now, if i just want to use Beautify, should i go with “Ignore Post Processing Option”, or does that also affect to quality of Beautify effects? And if i am going with "using only beatify" route, am i missing some important post processing effects?
     
  44. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    If you're using just Beautify, then yes, use the "Ignore Post Processing Option". It will run the Beautify effects (without quality changes or loss) allowing you to disable the "Post Processing" option in the camera which will shave a bit of overhead from the URP post processing system (the color grading pass is omitted for example) which is unnecessary if you're not using other effects from the URP post processing system.
     
    SirOhwell likes this.
  45. StripeGuy

    StripeGuy

    Joined:
    Dec 30, 2016
    Posts:
    52
    Hello, I made an account on your support forum, but unable to ask a question unless I buy it first, and same goes for discord. Your contact form doesn't work either, as it gives an error when submitting.

    I would like to know if your plugin supports anti-aliasing with alpha preservation? I am outputting to a Render Texture, and as soon as I turn on Post-Processing on the camera, the alpha turns solid color. As you can see in this thread, it seems to be a problem a lot of people would like to have working. Unity is "planning" it, but this will most likely take years to implement in a non-beta version.

    It would be amazing if your plugin supported this.
     
    Last edited: May 30, 2023
  46. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,
    Checked Beautify for built-in pipeline and yes, I can confirm alpha channel is preserved when rendering into a render texture.
    Regards.
     
  47. StripeGuy

    StripeGuy

    Joined:
    Dec 30, 2016
    Posts:
    52
    Sorry, I am using URP, not the Built-in. Thanks for the quick reply, though!

    If it works, you will have several new customers for sure!
     
  48. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Checked URP as well, alpha can be preserved. The culprit was the final pass of post processing which wipes the alpha channel. You have to disable Post Processing checkbox on the camera rendering to your render texture and enable the "Ignore Post Processing Option" in the Beautify Render Feature so it executes regardless of the post processing system.
     
  49. StripeGuy

    StripeGuy

    Joined:
    Dec 30, 2016
    Posts:
    52
    That's awesome. I bought your asset, but it's not working for some reason... Edit: Nevermind. I realized that I had to add a material to it that wasn't "Default" haha. All the effects work on the render texture with alpha, except for Edge Antialiasing doesn't seem to be doing anything at all, no matter which value I set it to.

    Btw, how do I post in your forums? I created an account but there's no "Create post" button. And Unity takes forever to generate the invoice number, so can't confirm invite on discord yet.
     
    Last edited: May 30, 2023
  50. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Just send a pm to Kronnect or to the admin on the Discord or web forum.
     
    StripeGuy likes this.