Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

[RELEASED] MadGoat SSAA and Resolution Scaling

Discussion in 'Assets and Asset Store' started by MadGoat, Mar 25, 2017.

  1. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    40
    Hi! I've just imported MadGoat into my project, and now my console full of the following error messages:
    Releasing render texture that is set to be RenderTexture.active!
    UnityEngine.RenderTexture:Release()
    MadGoat_SSAA.MadGoatSSAA:SetupRender(Single) (at Assets/MadGoat-SSAA/MadGoatSSAA.cs:281)
    MadGoat_SSAA.MadGoatSSAA:OnPreRender() (at Assets/MadGoat-SSAA/MadGoatSSAA.cs:172)

    Initially my project was on Unity 5.6 -- when I saw this error the first time. Than I updated Unity to 2017.1 (1f1) hoping that this'll help, but with no success. Still the same problem :( Disabling all components except basic ones on a camera where MadGoat lives does not seem to help.
    OS Windows 10 x64.
     
  2. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    40
    I finally got it working by this simple fix:

    var cameraTexture = currentCamera.targetTexture;
    cameraTexture.Release();
    cameraTexture = null;

    currentCamera.targetTexture.width = (int)(Screen.width * mul);
    currentCamera.targetTexture.height = (int)(Screen.height * mul);
    currentCamera.targetTexture.Create();


    Some kind of strange Unity behavior? Anyway, tell if this fix is correct and maybe include this in next release.
     
    hopeful likes this.
  3. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    Hello. I wasn't able to reproduce the issue but I'll include your fix if it doesn't interfere with other functionality. I'll look over it ASAP.

    Also have some new features and fixes regarding compatibility with third party offline render solutions, coming in the next update :)

    P.S. Sorry for late responses and not seeing all the emails/thread replies etc. I'm currently really busy with our studio's game project as our Kickstarter campaign will come later this year and we need to get things ready.
     
  4. orrinjones

    orrinjones

    Joined:
    Jan 14, 2017
    Posts:
    5
    Hi Can this be used for mobile platforms. I just want to downscale game resolution without affecting the HUD nothing else
     
  5. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    Hello, I haven't personally tested on mobile but it should work just fine :)
     
  6. orrinjones

    orrinjones

    Joined:
    Jan 14, 2017
    Posts:
    5
    Okay I have purchased and tested it and it works just fine as you stated. very handy I actual learned a thing or two from playing with the source code.
     
  7. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    30
    black screen (unity UI visible) - on android device, when built il2cpp (EDIT: mono too).
    webGL works ok.
    unity 5.6.3f1.
    SSAA settings like default 4x with F (FSSAA)

    adb last in log
    https://prnt.sc/gll9xy
    complains about not supported format for render texture
     
    Last edited: Sep 15, 2017
  8. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    Hello, what device are you testing on?
    Try to fiddle around with the RenderTextureFormat at line 129 and see what works. Try with ARGB32 for example.

    I really have no experience with mobile gpus and what they support and not. :( The plugin was designed with high end platforms in mind
     
  9. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    30
    ARGB32 is work on android, but slow fps (text updated by timer has lags),
    it's better on webGL due to hardware,
    our game contains many static images, need quality antialiasing,

    some other questions:
    -- why filtering params does nothing (sliders for cubic interpolation)?
    --which setting for SSAA will be like MSAA 8x? SSAA 4x or SSAA 8x (and which coeff? sqrt(8)?) for quality it should be better whan MSAA 8x? but now MSAA 8x is imho better than SSAA 4x, on thin lines
    but if I checkbox F it's blurred more than need , can I tune this blur?
    I append some screenshots, on all: left - unity with some setting, on right - flash.
    https://prnt.sc/glin04
    https://prnt.sc/glinfn
    https://prnt.sc/glinbs
    https://prnt.sc/glj97s
    FSSAA 4x is better on thin line (screen 2)(better than no F, on screen 3) but blurry on small scale (screen 4).
    -- may be you know which exactly antialiasing type is used in flash?
    I have tested many AA types, MSAA and SSAA give better results, but i don't know how to increase quality. Also exist some algorithms for vectorization with antialiasing on build time, not on post-processing, but it has some artifacts, and also take more time on runtime, which is costly on our svg runtime renderer
     
  10. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    40
    Actually, this still happens, but much less often, so this "fix" is not a legit fix at all) Seems like MadGoat texture create request sometimes starts to interfere with something else. But with what? Even if I turn off everything on a camera, including built-in post-processing script, this still happens. But with my portion of code I get dozens -- not thousands -- of errors.
     
  11. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    SSAA x4 is really not ideal for mobile devices as it renders at double the resolution (width*2 x height*2) causing performance issues. The MSAA and SSAA can't be really compared directly since they work differently. SSAA renders the whole image at a multiplied resolution, while MSAA is only applied on object's edges at geometry level (iirc). The disadvantage to MSAA is that it's not supported in deferred rendering, where SSAA might come in handy.

    As for the FSSAA's being to blurry, I will add a slider to control the power of it in the future update.

    I'm somehow still unable to reproduce the issue. Can you upload a scene that does it somewhere and send it to me? Would help.
     
  12. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    40
    I'll try to reproduce this behavior on a simple scene and if I succeed, I'll send it to you. Maybe it's some combination of post-processing effects (built-in and "foreign" ones) that causes this to happen.
     
    MadGoat likes this.
  13. icewuerfel

    icewuerfel

    Joined:
    Oct 22, 2016
    Posts:
    3
    Found a bug in the version 1.2, MadGoatSSAA.cs Line 711 ( ScreenPointToRay method). There is the position parameter but then you are using Input.mousePosition. That seems wrong :)
     
    MadGoat likes this.
  14. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    Version 1.3 is now out :)
    f4c3453b-1630-423f-ad65-102135f2a2b3_scaled.jpg 2bc826a2-0639-441e-84c8-dd5d68ccdaef_scaled.jpg 1f419c36-4f74-4f0a-9477-0b51904a37a3_scaled.jpg
    Changelog:
    - Added MadGoatSSAA_Adv script dedicated for offline rendering and other similar workflows
    - Added compatibility with MadGoat Debugger & Benchmark
    - Added option to change the internal image format (under General tab)
    - Added slider to control FSSAA intensity
    - Fixed a bug that was causing FSSAA to corrupt alpha channel when using offline render systems
    - Improved Nearest Neighbor image filter
    - Fixed a bug inside the ScreenPointToRay method
    - Fixed a bug causing "usefilter" in screenshots to automatically turn on when taking screenshots from editor
    - Performance improvements to the demo scene
    - Minor UI fixes
    - Minor code improvements
     
    wetcircuit, hopeful and ModularBuilds like this.
  15. charlsZgy

    charlsZgy

    Joined:
    Apr 28, 2017
    Posts:
    1
    Can you help me see how this works?
    NullReferenceException: Object reference not set to an instance of an object
    MadGoat_SSAA.MadGoatSSAA.Update () (at Assets/MadGoat-SSAA/MadGoatSSAA.cs:145)
     
  16. MadGoat

    MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    61
    I'll look into it as soon as possible.