Search Unity

PRISM - Realistic All-In-One Post-Processing for Unity [v3 BETA APPLICATIONS OPEN]

Discussion in 'Assets and Asset Store' started by GoGoGadget, Dec 12, 2015.

  1. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    I like the look of that, but how will the performance be combining sunshafts with this layered hdr bloom compared to the old bloom? They used to be "almost free" - so can the effects be combined in a similar way?
     
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    I haven't profiled yet, but in theory they will actually be cheaper! Since the sunshafts effect uses a 1/4 res downsampled texture, and the new layered bloom will *always* generate that 1/4 res texture, whereas the old bloom (on a standard setting of '2' downsample amount) had to perform one more downsample pass to get to the 1/4 res texture used by sunshafts. With that said, the difference probably won't be noticeable on desktop/nextgen consoles, and only barely on lower powered devices.

    Basically, any effects which were already sharing buffers with the bloom will still share them! In fact, the new bloom should also let me save 4 texture read operations used inside the lens dirt algorithm as well, making that a touch cheaper.
    Edit: Yep, now lens dirt is cheaper!
     
    Last edited: May 11, 2016
  3. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Two bits of news today, first up:
    PRISM v1.8 has been submitted to the Asset Store for approval, which features the new HDR layered bloom option, colored vignette, and a bunch of other improvements. Before this update, there was still a reason to think about using something like 'Ultimate Bloom' or 'Amplify Bloom' to get nice layered bloom, not any more. I may need to put a disclaimer on it though, the new HDR bloom option looks so good, you'll want to turn it way too high ;)

    Also, PRISM has been selected for the 24h sale! Save $15 when you purchase PRISM in the next 24h @ https://www.assetstore.unity3d.com/en/#!/content/50819
     
    punk, PeterB, rrahim and 2 others like this.
  4. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    341
    I've just purchased PRISM – everything looks really excellent and works perfectly. The only thing which doesn't work at all is fog. I get no fog at all; tweaking the fog settings results in odd white patches for extreme values, but I see nothing like the fog I'd expect (such as Unity's Global Fog).

    Also, I was wondering if there's a way of excluding things from bloom and DOF. Health bars for NPCs come to mind.

    Mac, latest 5.3.4 patch, HDR Linear Deferred.
     
    Last edited: May 12, 2016
  5. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    So, the first thing to try is the demo scene - you should see a purple-y fog when PRISM is enabled in the PRISM demo scene, PRISM's fog does use a different algorithm which exposes more variables than Unity fog, so it can require a bit of extra tweaking. If that still doesn't work, it'd be helpful if you could post a screenshot of the fog settings in your PRISM inspector, a screenshot of the issue in the game view, and your camera inspector.

    Regarding excluding effects, the best way to do it is to have those objects rendered as UI objects under a canvas, so they render after everything else in the scene.
     
  6. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    What is the difference with Scion post process effects ?
    https://www.assetstore.unity3d.com/en/#!/content/41369
    The pluging have a lot in common with Prism and it is as fast.

    So there is no Temporal AA and no cinematic motion blurr ? This is the two main missing components in these package effect plugins.
     
  7. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Those two effects cannot be combined with others, and are not combined in any game, so they're not really missing - there's actually a section of the PRISM Guide that explains why. For TAA, get Unity's new Temporal AA they've got on their bitbucket, I think it has (or should have) cinematic motion blur built into it as well.

    I personally don't own Scion, and am biased :) But as of 1.8 (when PRISM's new HDR layered bloom option will be in), IMO no single Scion effect will be objectively 'better' than any single PRISM effect, PRISM also supports more platforms (like WebGL/Mobile), has more scalable performance, a better workflow with PRISM-presets, and is still being very actively developed.

    So, you can decide, but honestly, as long as you're using combined effects (and not the haystack of separate effects that Unity are still pushing), you're making the right choice!
     
    Yukichu likes this.
  8. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    More platforms and more scalable performance is very important indeed, it will run faster than Unity 5 image effects plugins ?
     
    Last edited: May 13, 2016
  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Take a look at this post for the last profiling I did of the new Cinematic Image Effects. In short, yes, because Unity still aren't combining their image effects, PRISM has a large performance advantage over them.
     
    zenGarden likes this.
  10. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    I just bought it and like it so far. I would strongly request anamorphic flare to be incorporated in the PP stack! I believe there is a way to bypass the shader keyword limit, the shader has to be built in editor with a script that allows customer to choose the which aspect will be toggle-able in runtime, so the shader built from script will have always on effects(no keyword spent), effect to be toggled (key word cost), always disabled effect (keyword not spent), this way PRISM can get much needed additional features!
     
  11. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Thanks for your feedback - interesting idea about the shader keywords, although I do think PRISM is running out of 'much needed additional features', given that it's got more features than any other single effect on the asset store :)
    Shader keywords aside, it's worth pointing out that there is also a point at which the single-pass becomes 'too big' and starts to have diminishing returns on GPUs with smaller caches etc.

    With that being said, anamorphic flares are technically part of bloom, so I wouldn't feel bad having that as an additional bloom option, I think it isn't too 'feature-creepy'. Now, if you (or anyone else that wants this) could provide some screenshots of the exact flares you're talking about - that would help a lot. Again, no guarantees, but somewhere down the track this is something that makes sense to do some research on.
     
  12. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Something similar to that of "Amplify bloom" or "ultimate bloom" in the asset store. Unity default bloom has one, but that looks atrocious. I think "Amplify bloom" has a free trial version, should work better than a screen shot.
     
    GoGoGadget likes this.
  13. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    PRISM v1.8 is now live on the Asset Store! With new HDR layered bloom, improved inspector, new LUTs, usability tweaks, and more. Documentation has also been updated, and as always, patchnotes can be found here.
     
    Gametyme, punk and zenGarden like this.
  14. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,298
    I picked this up and I really like it! The new Bloom looks amazing. I might have accidentally spent an hour just staring at my SpeedTrees while playing with Bloom and GodRay settings.
     
    GoGoGadget likes this.
  15. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    554
    I keep getting this error on mac using 5.3.4.

    Tiled GPU perf. warning: RenderTexture color surface (231x172) was not cleared/discarded, doing <run with profiler for info>
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    PrismEffects:HandleGodrays(RenderTexture) (at Assets/PRISM/PrismEffects.cs:1972)
    PrismEffects:OnRenderImage(RenderTexture, RenderTexture) (at Assets/PRISM/PrismEffects.cs:1654)
     
  16. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Edit: See next post
    That one's a nice easy fix, just add in the line:
    Code (CSharp):
    1.         quarterResMain.DiscardContents();
    To the HandleGodrays function at around line 1970 of PrismEffects.cs, so that part of it will end up looking like this:
    Code (CSharp):
    1.         //Mask
    2.         Graphics.Blit(quarterResMain, preBlurtex, m_Material3, 0);
    3.  
    4.         quarterResMain.DiscardContents();
    5.  
    6.         //RenderTexture downSampledTexSec = RenderTexture.GetTemporary (quarterResMain.width, quarterResMain.height, 0, rtFormat);
    7.         Graphics.Blit(preBlurtex, quarterResMain, m_Material3, 1);
     
    Last edited: May 15, 2016
    Gametyme likes this.
  17. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    554
    After making that change fog and gods rays dont work on mobile(ios).
     
  18. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    I'll have to look into that then, sounds like it might be a Unity bug, all that extra function should be doing is clearing the RT.

    Until then, just replace the entire HandleGodrays function like this, it should work on all platforms;
    Code (CSharp):
    1.     void HandleGodrays(RenderTexture quarterResMain)
    2.     {
    3.         RenderTexture preBlurtex = RenderTexture.GetTemporary (quarterResMain.width, quarterResMain.height, 0, RenderTextureFormat.Default);
    4.         RenderTexture quaterResSecond = RenderTexture.GetTemporary (quarterResMain.width, quarterResMain.height, 0, RenderTextureFormat.Default);
    5.  
    6.         //Mask
    7.         Graphics.Blit(quarterResMain, preBlurtex, m_Material3, 0);
    8.  
    9.         Graphics.Blit(preBlurtex, quaterResSecond, m_Material3, 1);
    10.  
    11.         m_Material.SetTexture("_RaysTexture", quaterResSecond);
    12.  
    13.         RenderTexture.ReleaseTemporary(preBlurtex);
    14.         RenderTexture.ReleaseTemporary(quaterResSecond);
    15.     }
     
  19. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I noticed Ambient Obscurance can be really fast and can be great for mobile.
    Still will the plugin more precise shadowing like SSAO ?
     
  20. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Actually, the Obscurance algorithm that PRISM uses does pickup high-frequency occlusion, as it also uses the Normals G-Buffer/texture. The old algorithm that PRISM used (found under PRISM/Legacy Effects) is the sort of wide, imprecise obscurance that I think you're thinking of. To be honest, it could very well be called SSAO, Obscurance is just another name for it that was popularized by a paper in 2012 (I think) called 'Scalable Ambient Obscurance'.
     
  21. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    554
    Unfortunately, after making those changes, gods ray become broken on mac as well. I'll just change it back to how it was before until you have a chance to take a look at it. Thanks.

    edit: I deleted the package and reinstalled it now neither fog or gods rays work on mobile.
     
    Last edited: May 16, 2016
  22. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Do you get any errors that you can see? I can't seem to reproduce the issue on my end, maybe PM me so we can see what the issue is without spamming the thread too much.

    Also, a little teaser for a new feature in next update - Bloom Exposure for HDR bloom - so if you want to go absolutely crazy with Bloom values and not wash out the rest of your scene, you can.
     
    jmjd and punk like this.
  23. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,298
    I'm having issues with the fog too; most combinations of colors and distances just result in a huge blown-out solid white area with weird colors surrounding it. For example, I can't seem to make fog that darkens the terrain, only that lightens it. If I set the color dark, the fog becomes more transparent until it apparently loops around and turns bright white with weird colors again. Some kind of missing Clamp01 that's setting pixel color values negative maybe?
     
  24. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Right now PRISM's fog requires more tweaking than I'm happy with to get it looking right - in a future update (potentially next update, if all is going well) I'm planning on reworking the fog algorithm to provide a much simpler fog to fix those sorts of issues.
     
    PeterB likes this.
  25. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,038
    Upgraded to v1.8 - now getting this error:

    I really love PRISM - I think it's great, but I kind of think you should slow down a little on releases. There generally always seems to be small problems each time an upgrade is released.
     
  26. Ammattilainen

    Ammattilainen

    Joined:
    May 2, 2016
    Posts:
    4
    I made an empty project, imported PRISM, standalone build and run (with demo scene) and it doesn't work. Also doesn't work in my own project. Using newest unity (5.3.4f1). The builded scene does open, but it has 0 image effects. Any ideas anyone?
     
  27. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Yep, starting from next update, I'll be making an editor test suite which will use PRISM presets to test out every possible combination of effects, and test them out on both DX & GLCore before shipping any updates. That should help catch silly bugs like that one, which is fixed by replacing the two instances of:
    addedBlm.rgb
    with
    blmTex.rgb
    on line 965.

    Hmm, just tested this out, looks like an issue with Unity's shader compiler working in-editor but not standalone, to confirm, it works as intended in editor? I'm currently working on a fix for it, which will be submitted to the Asset Store sometime tomorrow for approval, or you can PM me with your invoice # for it as soon as it's ready.
    Edit: PM'ed you.
     
    Last edited: May 17, 2016
  28. Ammattilainen

    Ammattilainen

    Joined:
    May 2, 2016
    Posts:
    4
    Yes it works in editor. If you can fix it by tomorrow, it's totally okey for me. Need to make the actual build around next monday anyways, so no rush.
     
  29. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,038
    FYI - just did a build and I also have the issue that effects work in the Editor, but not in the built executable. Building for MacOS. Haven't tried Windows build.
     
  30. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Yep, the fix for that has been submitted to the store, some annoying unexpected behaviour with shader_feature. Good news is, the fix also removes an extra shader keyword.
     
    punk likes this.
  31. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    341
    The Obscurance algorithm in PRISM doesn't seem to respect world-space UI elements. I work a lot with diegetic interfaces, which using PRISM have become semi-transparent:

    Screen Shot 2016-05-17 at 23.59.25.png

    PRISM computes obscurance even though the canvas is non-transparent.

    I could of course work around this by adding a plane behind the UGUI Canvas to hide the normals of the material behind it, but shouldn't PRISM respect the non-transparency of the canvas?
     
  32. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    So, in order to combine everything into the same pass, PRISM's obscurance draws at the same time as the rest of PRISM's effects, so this is the expected behaviour, and you'll probably have to add a plane behind that. I've just gone ahead and added a section to the PRISM guide under the "Fog" and "AO" sections of "In-Depth: Effects" which clarifies this, and suggests a workaround if you don't mind all of PRISM's effects drawing before transparents.
    Cool looking UI btw!
     
    PeterB likes this.
  33. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    341
    Thanks for the speedy reply! PRISM is so good and so much faster than the competition that it definitely is worth making a few adjustments to geometry.
     
    GoGoGadget likes this.
  34. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    PRISM v1.8.3 is now live on the Asset Store, with a bunch of fixes, and two new minor additions:
    • Bloom Exposure - Control the exposure of your HDR bloom effect with this new slider, which allows you to apply a much larger range of intensities to your bloom without washing out the scene
    • Cinematic Vignette - A simple change to PRISM's vignette algorithm that aligns it with a more cinematic style of vignette, which reacts to light rather than overlaying the screen
    Anyone that's currently using a 1.8 version of PRISM should update to this latest version as it fixes the build issue, which I've reported to Unity and had confirmed as a bug.
    As always, patchnotes can be found on the google sheets page here.
     
    Last edited: May 20, 2016
    punk and Gametyme like this.
  35. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    I got a sample of image from space engine that looks pretty nice, can it be replicated in PRISM?

    And In addition, any plan to add lens flare to the stack?
     

    Attached Files:

    GoGoGadget likes this.
  36. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Right now no, but in the future it may be a topic that will be looked into -- see this post. Development focus right now is improving some current effects like fog, adding to the subset of effects that can be used in WebGL, creating more tutorial content, and further improving stability and performance across all platforms.
     
  37. Gozdek

    Gozdek

    Joined:
    Jun 21, 2015
    Posts:
    356
  38. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    304
    Not related to PRISM specifically but, what postprocessing effects besides bloom are typically employed in 2D games, like twin-stick space shooters?
     
  39. wadewt

    wadewt

    Joined:
    Mar 17, 2013
    Posts:
    14
    Hello, really enjoying PRISM, it's pretty nice. I was wondering if there was a way to use custom bokeh textures?
     
  40. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Would motion blur benefit from addition to the stack? If so, is there a plan to add it?
     
  41. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    I may have to look into this to see how much performance I can gain. I use scion and amplify color together... and it looks good. I'm always looking for more performance and scalability, especially developing on a laptop
     
    GoGoGadget likes this.
  42. youblistermypaint

    youblistermypaint

    Joined:
    Aug 5, 2015
    Posts:
    14
    Hello again, we talked awhile ago about vignetteing performance on mobile hardware. (posted above as a reminder but the discussion is on page 2).

    I'm now at a point where I can start looking into replacing the stock vignette shader, but things have changed since I initially asked this question, I am now using the "blurred corners" option attached to the stock vignette shader in my menus.

    Just so I can make sure they are functional similar do you mind posting a screenshot of the inspector options associated with your vignette shader so I can ensure it's a good fit for my project?
     
    Last edited: May 28, 2016
  43. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Hi there, first off, sorry for the late replies, I've been over in Sydney this weekend on business - planning to use PRISM in a very cool (TBA) project over there.

    I'll be honest, 2D is really not my forte, but you could definitely use the colour correction LUT to unify your levels visual style, gamma correction will be handy particularly if you are deploying to WebGL (lots of people with wacky monitors out there), and PRISM's vertical Chromatic Aberration can look great as an on-hit effect.

    PRISM's bokeh is actually not texture-based, it's organically created from the sample positioning, and unique to PRISM's DoF algorithm, so no, there is no way to change bokeh shapes.

    Motion blur should be combined, but with TAA (eg. PlayDead's TAA). I haven't checked out Unity's new TAA on their bitbucket, but that's where you should see motion blur as an option, if they're doing it right.

    Here you go.
    What effects (apart from vignette) are you currently using? I'll be able to give you a rough idea of how much performance you'll save, but if it's only vignette, then you're better off just using the single effect.
     
  44. youblistermypaint

    youblistermypaint

    Joined:
    Aug 5, 2015
    Posts:
    14
    This is roughly what I am using right now:



    I found a better vignette shader that sadly does not support blurred edges, so I am swapping between that and the image effects shader when needed (don't use blurred edges during gameplay, just menus).

    You can ignore Camera Effects Behavior here, it's just a script I have to manage effects.
     
  45. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    Hmm, I would be surprised if you gained any major performance improvement with PRISM, since you're only using 2 effects, and the fast vignette (I'd assume) is already mobile-optimized. One thing about PRISM's noise is that some old mobile GPUs don't like the PRNG that it uses, which is why that's one of the few effects in PRISM that's not recommended for mobile. Also, it doesn't have a "scratch" effect (which is really just a texture overlay with some movement parameters), so you'd have to sacrifice that as well.
     
  46. youblistermypaint

    youblistermypaint

    Joined:
    Aug 5, 2015
    Posts:
    14
    I figured I was hitting the end of what shader optimization can do. Thanks for your candor.
     
    GoGoGadget likes this.
  47. CreatureSurviive

    CreatureSurviive

    Joined:
    May 3, 2014
    Posts:
    10
    I don't know what I'm doing wrong, but I can not get rid of these lines in my AO for the life of me. They kind of ruin the effect. does anyone have any pointers? I'd appreciate it.
     
  48. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    So, try changing the AO Bias - that should have a positive effect if you increase it. From a guess, those artifacts could be caused by having a very 'small' scale scene, ie. I've seen them before in one of my testing scenes with a camera that only draws out to 2 units, and they'll occur because floating point precision isn't high enough for those tiny values. Can you screenshot the settings on your camera as well, and screenshot a 1x1x1 unit cube in your scene for reference?

    While we're on the topic of AO, check out this really cool comparison on AO Assets, which includes PRISM: http://www.invisiblerock.com/2016/05/25/ambient-occlusion/ - PRISM comes out equal first for performance, even without any other effects combined with it!
     
    Last edited: Jun 6, 2016
  49. CreatureSurviive

    CreatureSurviive

    Joined:
    May 3, 2014
    Posts:
    10
    Thanks for responding, I just tried adjusting the AO bias with no luck even when maxed. Scene scale shouldn't be an issue its an open world game and the scene is 4700x4700 units. here is the same perspective with a 1x1x1 cube



    and a shot of my camera settings

    I'm using forward rendering and linear color space if that makes a difference.

    I actually just read that write up on AO a little while ago. Thats actually what informed me that PRISIM was capable of much higher quality AO then what I was getting, I've been having this issue for a while now I just figured maybe PRISM does have great AO until I saw that write up, and thats what encouraged me to investigate further.
     
  50. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    651
    I'll PM you some things we can try so we don't clog up the thread, initial thoughts are that is quite a large far camera distance.