Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PRISM - Realistic All-In-One Post-Processing for Unity

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

  1. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Very strange that it only occurs on some iOS devices but not others. First question, may be an obvious one, but does the issue disappear when fog is turned off, and can you give a screenshot of it? There's nothing in PRISMs fog that technically should cause banding, initial thoughts are that looks like some sort of Depth texture precision issue.
    You can PM me so we don't have to spam the thread.
     
  2. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Without fog:
    Screenshot-2016-09-27-17.40.29.jpg
    Sorry for not PM but there is no way to upload files there. Now we can continue PM if you prefer.
     
    GoGoGadget and punk like this.
  3. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    @mcmorry Damn, son! Nice looking game.
     
    mcmorry likes this.
  4. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Thanks :) we just got approved on the Apple store today and will start with a soft launch probably tomorrow.
     
    punk and SteveJ like this.
  5. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Awesome, after seeing that, I'd almost say keep the fog off, great looking game!
    Thanks for the screenshot, I will send you a test shader in PM which will confirm/deny what I suspect that could be.

    While I'm posting, here's a little sneak peek at an upcoming feature in PRISM 2.0 - a nice luma sharpen with a color enhance effect added on as well - take a wild guess where I got the inspiration to add this from ;)
    Off (and comparison):
    Off.png
    On:
    On.png
    I will say, in the process of adding this sharpen, I tried out a bunch of different algorithms (simple kernels, adaptive sharpening, depth-aware sharpening, multi-pass sharpening) but this one comes out the nicest, and performs quite well. Blur-Be-Gone!
     
    punk, Shodan0101, chiapet1021 and 3 others like this.
  6. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Looks awesome, and I assume this will work beautifully with DoF?
     
  7. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Perfectly, since when using sharpen, you should probably have the DoF stability option on as well, which passes the DoF texture through a small median filter - basically, it means that sharpen won't affect any really blurry parts of the DoF, for 'free'!
     
    punk, yc960 and mcmorry like this.
  8. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Is it possible for you to add eye adaption?
     
  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    I'd better say yes, since PRISM already does have eye adaptation in it ;)
    One of my last TO-DOs for 2.0 is a rework on eye adaptation though, not super happy with the current implementation as it requires too much fiddling around with 'magic' values.
     
    punk, yc960 and Gametyme like this.
  10. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    The new sharpen is super welcome :)
     
    GoGoGadget and Shodan0101 like this.
  11. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    a update on the keyword reduction, turns out you need to cut out all the scripts that reference those keywords as well, since PRISM is generating materials on the editor with reference to those keywords
     
  12. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Ugh, was actually not aware that's how Unity do it, that's not particularly smart. Will be doing a few more passes on trying to trim keywords for 2.0 in that case. I bet there's some hack to restart Unity and make sure that the script doesn't reference the keywords after a restart that makes the keywords not used freed up, but not keen on going down that rabbit hole.
     
  13. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @GoGoGadget I didn't have time yet to test the shader you sent me for the fog, but I just saw a plugin for the fog on Level 11 and would be nice if you could improve the settings for the fog to set the colors and intensity in a similar way: using a gradient color selector so that would be easy to set where the colors should blend (and maybe even more than 2 color).
    As it is now, I'm still not able to foresee what I'll get when changing the hidden value Fog Height. For example is not clear if it is related to the camera frustum or not. (also is not an height but a sort of distance).
     
    GoGoGadget likes this.
  14. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Will take a look at that - in fact, as I was having a look at fog I think I may have found another post on someone who encountered what looks to be a similar issue on iOS, so that's a good lead.

    On an unrelated note, I'm getting a mate of mine to make a trailer for PRISM 2.0, and thought it'd be a great idea to showcase any current games that are using PRISM, if possible. So, if you have ~10 seconds of good looking gameplay recorded and want your game to be featured in the next PRISM trailer, send me a mail with the highest bitrate video files you have, as well as your game's logo and what platform it's on. Google drive works well for this, or filemail, and you can PM me the link here on the Unity forums once uploaded.
     
    yc960 and mcmorry like this.
  15. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Poll time - regarding PRISM's DoF settings, would you:
    1. Like them to stay as they are (linear falloff, easy to get started)
    2. Like to see them switch to an F-Stop/Focal Length/Camera simulation style settings, like other DoFs
    3. Switchable between 1) and 2) (will possibly cost an extra shader keyword)
    4. ??? (Please post suggestions)
    Edit: Looks like option 3 it is!
    The advantages of 1): It's the easiest, and works very well for far-field DoF in simple setups, as well as being able to keep the values on all your PRISM presets in 2.0.
    The advantages of 2): Much easier/better for putting focus on a single character (eg. cutscene DoF).
    3) May possibly fit in without an extra shader keyword, although can't say for certain yet. I'm currently leaning towards 1), with the possibility of making near blur slightly more tweakable.

    This comes up as tonight I got my new-ish DoF implementation setup for 2.0. It's more of a 'framework' change than an actual blur algorithm change, but the blur has been improved quite a bit by doing a proper CoC pass. It uses MRTs to do what PRISM does best, save on Blit passes -- after implementing MRTs, perf improved by 0.6ms! Also quite happy because every part of the new DoF is very modular - for instance, in theory it should be possible to use a completely different blur algorithm for near-field DoF (without touching Far-Field, or introducing any other passes), just by changing a function call.
     
    Last edited: Oct 5, 2016
    yc960, Shodan0101 and punk like this.
  16. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I liked a lot how easy it was to set DoF, so if you really want to extend it, please consider the option 3 :)
    Also a possible new feature could be to expose a minimum blur value, so that also the area that should be on focus could be blurred. This could be used for underwater effect or for some cinematic effect by animating the min blur value.
     
  17. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    GoGoGadget and Gametyme like this.
  18. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    option 3
     
    GoGoGadget and Gametyme like this.
  19. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Feature request! can you do chromatic blur tied to DoF? Like the one in the picture? It is from CG film the looking planet.
     

    Attached Files:

  20. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Option 3.
     
    GoGoGadget likes this.
  21. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Looks like option 3 it is! I think it would be quite easy to a settable min blur value as well, thanks for the suggestion!

    With the way the default DoF works, that isn't possible. To do that in games, you use a texture-based DoF which splats bokeh textures on everything, and it's the bokeh textures that you bake the aberration into. Like I said before though, swapping the new DoF's blur algorithm is as easy as changing a function call, so while that probably won't make it into 2.0, there's no reason it wouldn't be possible.

    Also just an update for anyone looking to send trailer footage, it would probably be easier if you sent a full trailer, just so we can cut the 10 seconds (or so) out that fits in best.
     
    mcmorry likes this.
  22. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Another feature:
    I had to set prism to render before transparent objects because DoF was causing issues with particle effects.
    Consider a smoke effect with particles going up, and a camera looking horizontally. The particles become more and more blurred based on the altitude because the depth behind them was increasing.
    The problem that I have now is that Fog, LUT and Bloom are not effecting anymore particles and glass.
    Would be very useful if DoF could be executed before transparent objects and all the other effects after them.
     
  23. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Now, this one is trickier, I will try include an option for that in 2.0, but in all likelihood it will add another component to the camera, due to how Unity's Image Effects are designed to work (no way in OnRenderImage to grab both Opaque and transparents, it's either one or the other). There's probably some way to do it with command buffers, but they're super touchy, and broken in half of 5.x, so I don't really want to go down that route.
     
    Shodan0101 and mcmorry like this.
  24. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Managed to get DoF (foreground + bg) down to 0.6ms @ 1080p today, and I haven't even done my final major optimization, depth mips.
    I was inspired a bit by "The Baking Lab" (https://mynameismjp.wordpress.com/2016/10/09/sg-series-part-6-step-into-the-baking-lab/) by MJP, and was pleasantly surprised when I opened up his DoF implementation to find that I was already on the right track, using 2 MRT passes to do CoC and blur for both foreground and background at once!

    MapScreenshot83.png
    On top of that, thanks to my new CoC method, near blur is a lot better - it spreads "over" the background, and any areas blurred in the background do not take samples from the foreground area.
     

    Attached Files:

    Squize, yc960, punk and 3 others like this.
  25. Natoneus

    Natoneus

    Joined:
    Oct 15, 2016
    Posts:
    2
    Hey, not sure if this has been discussed somewhere, but I can't find it. I have errors when building with Unity Version 5.4.0f3.
    Getting these warnings:
    WARNING: Shader Unsupported: 'Hidden/PrismEffectsTertiary' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PrismEffectsTertiary' - Setting to default shader.
    WARNING: Shader Unsupported: 'Hidden/PrismEffects' - Pass '' has no vertex shader
    WARNING: Shader Unsupported: 'Hidden/PrismEffects' - Setting to default shader.
    Also this:
    Prism is not supported on this platform, or you have a shader compilation error somewhere. Disabling.

    Prism has been amazing to use and has really helped define the visuals of our app. It works perfectly in the editor and Unity game window. Just doesn't show up in our build. This is a screen from the Unity game window.
    Screen02.jpg
     
    mcmorry and GoGoGadget like this.
  26. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    First off, amazing looking game!

    Not a known issue at the moment, it was with an earlier version of PRISM but haven't heard any reports of it on the current version. If you are on the current version, then can you do the following (probably in PM so we can sort this out ASAP without clogging up the thread):
    • Send a screenshot of your PRISM inspector
    • Are you building on Windows/Mac? (What platform is the build failing on)
    • Does the issue disappear if you try to build with some effects on PRISM turned off (ie. AO)?
    Thanks
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I currently use a combination of Unity image effects, Filmic Tonemapping Deluxe, Colorful FX, and GPFX for my stacked set of effects. I actually want to add many more effects, but stacking them is certainly a performance problem. So, I've decided to finally take the plunge and pick up PRISM and see if it can outperform my post processing stack and give me even more. I really want to add depth of field, fog, ambient obscurance, and godrays. I use the Wii U so I'm pleased to see it has been tested there. I will pick this up tonight and try it out and report my results here. I'm looking forward to really enhancing the look of my game with this.
     
    GoGoGadget and Shodan0101 like this.
  28. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I just got a decent test going on the Wii U. I had to play around quite a bit with the settings and turn off some of the features, but I was able to get tonemapping, HDR bloom, fog, and depth of field for about the same performance as I was getting with my stacked effects, but PRISM looks far better.

    However, I'm seeing a strange issue on the Wii U where some big black blocks are popping up from time to time on the screen while looking or moving around. Any ideas what this could be or if there might be fix?

    upload_2016-10-18_19-7-4.png

    [EDIT]
    I'm using Unity 5.3.6p2
     
    Last edited: Oct 19, 2016
  29. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    First off, great to hear you're liking PRISM at the moment!

    In regards to that issue, I've just replied to your email, but to add to that, I know @scheichs was using PRISM on WiiU a while ago so he may also be able to help you out.
     
  30. scheichs

    scheichs

    Joined:
    Sep 7, 2013
    Posts:
    77
    Hi there, I tested it with Wii U on LDR camera and I don't recall which version of Unity it was. I decided to stay with Scion and Unity stack, because of issues with the god rays at that time and because I preferred the look of Scion's DoF. I will try PRISM with my next project because people are quite happy with the look of the game right now so I won't change it with an update.
     
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks for the information. I tracked down my issue to the HDR Bloom effect. The author is investigating for me. I was able to use Simple Bloom without an issue, but the visual results are not as nice.
     
  32. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I just noticed an issue with the fog. It overwrites transparent objects that are in front of it. Here I'm looking through a window; the crosshatch should be completely black everywhere but you can see that the fog on the mountains in the distance is actually rendering on top of the window in the foreground:

    Capture.JPG

    Any idea how to fix this? I'm using Deferred Rendering, though I believe Unity automatically does transparent objects with Forward Rendering regardless.
     
  33. MS_3D

    MS_3D

    Joined:
    Sep 18, 2014
    Posts:
    6
    Hi - Does the Prism DOF Effect work correctly with transparent Materials?
     
  34. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    The unity offical post stack is out! https://github.com/Unity-Technologies/PostProcessing
    Now it combines like everything into one pass and looks like an improvement on the chromatic abberation. SInce unity is binding EVERYTHING into single pass.
    Would that approach benefit adding effects in PRISM?
    And would there be support for user to add custom image effects into the PRISM stack?
    How much performance benefit would you say that will give if you add SSRR,TAA and moBlur into PRISM?
     
  35. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    PRISM is really working great for me. I had a short playtesting session of my game last night on the Wii U and 2 people who never saw the game before commented on how great they thought it looked. One said that they were very impressed and didn't think the Wii U could do something that looked that good. I believe a lot of credit for how good it looks goes to a combination of PRISM and uSky Pro. Thanks for making such a great asset.
     
    Shodan0101 likes this.
  36. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    One of the limitations with the way PRISM combines passes (as detailed in the PRISM Guide) is that this can occur, as it doesn't use the [ImageEffectOpaque] tag. If you want to, you can add that above OnRenderImage, with the drawbacks that come with it.
    2.0 May have a fix for this, but I'm still experimenting.

    Yep, saw that! It would give no performance improvement if you integrated those 3 effects into PRISM anyway, as they're combined already (well, as much as TAA can be combined, aka, not much). Also the TAA is very dodgy and fails in gameplay, I wouldn't want it anywhere outside of a cutscene.

    I've had a look at Unity's new stack, only thing really impressive was their bloom's performance, apart from that, the chromatic aberration is for cutscenes only, AO is the same as PRISM's but with less features, doesn't have DoF at the moment, and has generally a lot less other features (fog/godrays/dual-LUT-etc). Like all things Unity, maybe it's ready for certain games, but I wouldn't touch it in production for another 6-12 months, and even then, it gives a different look - not necessarily better or worse.

    Great to hear! Just replied to your email about bloom as well!
     
    Shodan0101, yc960, Gametyme and 3 others like this.
  37. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
  38. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    I guess that means significant bloom performance gain in PRISM 2.0?
     
  39. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    You can tweak PRISM's AO to respond to light differently by applying less AO where there is lots of light, that's in the "Advanced AO Options" toggle.

    Yep! Been trying to crack the 0.5ms mark with Simple Bloom (but with a reworked algorithm so it looks a lot nicer than current simple bloom), and HDR bloom will cost less as well. Also, 2 new threshold options which can make the bloom look completely different depending on what suits your game.
     
    yc960, Shodan0101 and mcmorry like this.
  40. Ammattilainen

    Ammattilainen

    Joined:
    May 2, 2016
    Posts:
    4
    Hi, is there any possibility to add ignore layer in prism? We are making 3D UI for VR and all the prism effects apply for UI making it all blurry and luminous. Or is there any easy solution, like go to PrismEffects.cs, line x and put this code in there, done?
     
  41. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    So basically a layer that PRISM doesn't affect?

    There's no easy way to do that, no, what's typically recommended is to render your UI after your camera, or render your UI to a separate camera that doesn't have image effects on it. Short of that, any real solution would probably require you to use a custom material for each UI element that writes to stencil + gets checked after.

    Edit: Couldn't help but share the results of some late night coding tonight - managed to get my real gaussian bloom to comfortably beat Unity's new combined Post-Processing (with 4 bloom mip levels and bloom stability). Also, it still generates a free UI blur texture which Unity can't do with their fake gaussians!
    PRISM 2.0 (in-dev)
    upload_2016-10-27_1-10-15.png
    Unity's "new" PostFX
    upload_2016-10-27_1-10-0.png

    Unfortunately some tests on Android tonight reminded me why I kept DoF simple in PRISM 1.x, running into some very annoying mobile compatibility issues with my new DoF setup in 2.0, still need a while to iron out all those before 2.0 nears readiness.
     
    Last edited: Oct 26, 2016
    mcmorry, yc960, magique and 2 others like this.
  42. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    That looks so impressive GoGoGadget!! Welldone on beating Unity's new combined Post-Processing! Proud to use your asset in my game!
     
    GoGoGadget likes this.
  43. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Regarding on the 2.0 features:
    Does it finally have lens flare?
    This is one of the only remaining aspect that Scion has an edge. A proper lens flare is paramount for the filmic feel. Even when no performance is gained, it needs to be included so the image effect order is CORRECT. Part of the unity stack philosophy. Right now I am using an outside lens flare solution that is very suboptimal.

    Anamorphic flare?
    if Beautify can have anamorphic flare (although VERY primitive) and HDR layered bloom and have it render in less than 0.5ms on 980m, i think it is not a technical limitation. Even if there is no perf gain, it needs to be inside the stack to be rendered CORRECTLY.

    Everything else seems very good, keep up the good work.
     
    GoGoGadget likes this.
  44. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    It is 100% a WIP, but short answer is yes, I really want to get lens flare in for 2.0. Fair warning though, I'm trying to go for a bit more than the cheap "VERY primitive" lens flare - tried that and not happy with it (hence no screenshots).
     
    yc960 likes this.
  45. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Speaking of very WIP, did some more work on the flares over the last day, still have to add in a few extra features and do a bit more tweaking/optimization but the base flares are working nicely with the new "Highlights" threshold bloom method in 2.0:

     
  46. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    How is the 2.0 going ATM? I can help you test it if you want.
     
  47. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Currently on track for a December release (ideally 1 year after PRISM 1.0 would be nice if timelines end up syncing)!

    I'm away with limited internet access from tomorrow for 2 weeks, but right after that I'll have 2.0 beta versions to send out to anyone that wants to test the new features.

    In the meantime, a new feature coming to 2.0 that's been requested quite a bit: Soft-limit Brightness. Basically, it's a really nice brightness function that is driven by an easy-to-use curve (only 3 parameters - Intensity, cutoff, softness).
    Off:

    On:
     
    Last edited: Nov 22, 2016
    magique, yc960 and mcmorry like this.
  48. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    I've been doing some testing on Android and I'm having some issues. In the Android monitor I get a message saying "Prism (tertiary shader) is not supported on this platform. Disabling some effects.)" - so presumably not compatible with this particular device (lack of SM3.0???). Anyway, the issue is that the game then crashes...

    If I turn off the Prism component on the camera and build the project again, the game runs fine (i.e. just without Prism effects).

    So the question is... should Prism "gracefully" disable itself on platforms that don't support it? It really seems like in this case, it's causing the app to crash.
     
  49. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    I thought the docs has a section on mobile use, where you have to mannually add a line or something?
     
  50. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    I am getting loads of warnings on 5.5.0f2 fresh import. they all point to texture importer.