Search Unity

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

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

  1. Jona-Marklund

    Jona-Marklund

    Joined:
    Jun 27, 2012
    Posts:
    34
    Hi!
    Great asset, really liking it so far, however, when I add Use Exposure Adaption to my stack, I get a RenderTexture reference loss.

    Here's an image of my stack, running 5.5.0p3 and PRISM 2.0.3. PRISMFEEDBACK.jpg
     
  2. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    When I turn on depth of field I get a flipped image.. what am I doing wrong?
     

    Attached Files:

  3. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    PRISM has just been updated to 2.0.3 on the Asset Store today which fixes this issue with flipped screen when using MSAA. Update and you should be good to go!

    Hmm, shouldn't happen, just tried to repro it and no luck - try updating to the newest asset store version, that should cause a reimport/refresh that fixes it. If it's still happening, PM me a repro and I'll take a look at what's happening, but it is likely just a Unity import-related issue.
     
    Shodan0101 likes this.
  4. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @GoGoGadget I finally have the chance to test the new version 2.0.3.
    It looks amazing!
    Unfortunately is so different from version 1 that I'll have to review all the values. But it will be wrothing :)

    So far I found an issue with Near DOF. I can't have it working. I tried with and without MTR (wich I'd prefer as I'm targeting mobile).
    Also why the near DOF has now another Focus Point? I don't understand the logic.
     
    GoGoGadget likes this.
  5. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Great to hear you're liking it so far! I'll have to add a fallback to use near blur without MRTs in the next version (and test that out some more) - shouldn't be too hard and I understand your use case.
    The near focus point can be exactly the same as the far focus point if you want (making it behave the same as before), it's more as an added option just in case you want to really customize your focal plane (for blurs that may look different to standard DoF, or for some firstperson games to make 'Weapon Blur' easier).
     
    mcmorry likes this.
  6. Jona-Marklund

    Jona-Marklund

    Joined:
    Jun 27, 2012
    Posts:
    34
    @GoGoGadget Made sure to test that first, I've re-created and started uploading a project to my dropbox, I'll PM you the link. Thanks!
     
    GoGoGadget likes this.
  7. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Error in Editor:

    Shader error in 'Hidden/PrismEffects': maximum ps_4_0 sampler register index (16) exceeded at Assets/PRISM/Shaders/Prism.cginc(988) (on d3d11)

    Compiling Fragment program with PRISM_USE_EXPOSURE PRISM_HDR_BLOOM PRISM_USE_STABLEBLOOM PRISM_USE_DOF PRISM_LINEAR_LOOKUP PRISM_ROMB_TONEMAP PRISM_USE_FLARES
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP

    getting this error and somehow PRISM is shutting itself down and not letting me turn it back on. Attached is the preset I am using, 5.5.0p3

    Error when building for standalone windows:

    Shader error in 'Hidden/PrismEffects': maximum ps_4_0 sampler register index (16) exceeded at Assets/PRISM/Shaders/Prism.cginc(987) (on d3d11)

    Compiling Fragment program with PRISM_DOF_USENEARBLUR PRISM_USE_EXPOSURE PRISM_HDR_BLOOM PRISM_USE_STABLEBLOOM PRISM_USE_DOF PRISM_LINEAR_LOOKUP PRISM_ROMB_TONEMAP PRISM_USE_FLARES
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP

    and

    Shader error in 'Hidden/PrismEffects': maximum ps_4_0 sampler register index (16) exceeded at Assets/PRISM/Shaders/Prism.cginc(988) (on d3d11)

    Compiling Fragment program with PRISM_USE_EXPOSURE PRISM_HDR_BLOOM PRISM_USE_STABLEBLOOM PRISM_USE_DOF PRISM_LINEAR_LOOKUP PRISM_ROMB_TONEMAP PRISM_USE_FLARES
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP

    PRISM 2.0.3
     

    Attached Files:

    Last edited: Jan 15, 2017
  8. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    bloom is acting all funny in actual build, see attached image. It is working fine in editor.

    Now, I will not argue that this effect is interesting and might be worth keeping, but let it be an option for me.
     

    Attached Files:

  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Will take a look at that, think I know what could be causing it, related to bloom dirt in 2.0. For this version, unticking bloom dirt should fix both of those things, looks like a SM4 limitation.
     
  10. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Ok, I managed to recreate the
    "
    Shader error in 'Hidden/PrismEffects': maximum ps_4_0 sampler register index (16) exceeded at Assets/PRISM/Shaders/Prism.cginc(987) (on d3d11)

    Compiling Fragment program with PRISM_DOF_USENEARBLUR PRISM_USE_STABLEBLOOM PRISM_HDR_BLOOM PRISM_USE_DOF PRISM_LINEAR_LOOKUP PRISM_USE_EXPOSURE PRISM_UIBLUR PRISM_ROMB_TONEMAP PRISM_USE_FLARES
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP
    "
    bug with the demo scene in a fresh project 5.5.0p3, linear color space, defer rendering

    attached is the preset file.

    This bug is driving me nuts, worse is that now it also disables PRISM completely. DO NOT DO THIS, if you are not gonna fix it, at least let me use it with the bugs.
     

    Attached Files:

    GoGoGadget likes this.
  11. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Thanks for the repro - I've gone ahead and removed the auto-disable feature of PRISM for the next update. This error will only pop up in the rare cases that you're using (almost) every one of PRISM's effects that requires a sampler. Some engineering will be required to fix this - will likely have to remove the color flare texture and replace it with a gradient selector, and put the second LUT under another conditional compile.

    While I'm here, I've been quite busy working on the next update, which is mainly full of mobile fixes, and also some nice new changes including a new "Bloom Radius" option under "Advanced Bloom":


    Bloom Radius Increased:
     
    yc960 and mcmorry like this.
  12. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi!
    I'm looking for a fastest possible AO solution to use in mobile.
    Currently Amplify's AO gave me the best result (only one that is 30 fps capable on targeted devices) but introduction of bloom and fxaa is almost imposible.
    Does Prism has Obscurance only, or there is an Occlusion too?
    Is Prism's AO likely to be slower or faster than Amplify's Occlusion?
     
    Last edited: Jan 19, 2017
    GoGoGadget likes this.
  13. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    It seems to be heavily tied to the DoF, in order for me to turn on DoF without the error showing up, I have to turn off over half of my effects.
     
    GoGoGadget likes this.
  14. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    I like this question! (Mainly because I was doing a big runthrough of all of PRISM's effects on mobile the other day, AO included).
    When I tested PRISM's AO, on minimum settings, @ 1080p on a nexus 5x, it was hitting around 30fps in a vertex-lit, lowpoly scene. To be honest, unless an AO solution is built for mobile only, then I would avoid using it on mobile, where every instruction counts. What devices are you targeting out of interest?
    Also, I've never tested Amplify AO, but would be very surprised if PRISM's was noticeably slower on min. settings.

    To explain that error a bit better, each DirectX shader model (at least up to and including DirectX11) has a hard limit of 16 samplers (less on SUPER old DX versions). In Unity/Shaderlab, each *texture* that you declare in a shader automatically takes up a *sampler* spot *and* a texture spot. This is due to some back-end macros that Unity uses which generally, make everything easier.
    Now, PRISM doesn't need more than 16 samplers in its main pass, but it (now, after 2.0, when most effects are on) does require more than 16 textures. What I'm working on for next update is a way to workaround Unity's inbuilt macros for textures/samplers, so I can make more than 1 texture share a sampler - eg. both 3d LUT textures can share the same sampler, all bloom textures can share the same sampler, etc.
    Hope that clarifies it! Also for your intermediate bugfixing, Flares use up the most sampler slots, followed by HDR bloom, then DoF.
     
    yc960 likes this.
  15. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi I'm targeting iPhone 5s and up. with relatively simple scenes.
     
    GoGoGadget likes this.
  16. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Will probably get around the same results as the nexus 5x then, you'd really struggle to put more than just AO on it unfortunately. If you know shader code, it'd be doable with some extra optimizations, but it's not really the sort of thing that's within scope of a generic AO effect like PRISM's.
     
  17. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    I wish someone did mobile AO.. no one sells it now(

    And two more questions:

    There is a difference between Standard Asset's Ambient Occlusion and Obscurance effects - with Occlusion there is a glitch (a shadow on the edges of some meshes with semi transparent textures), with Obscurance there is no such glitch.

    Question 1 - is there a glitch of that kind with PRISM Obscurance or there isn't?

    Example difference:
    https://www.dropbox.com/sh/3hq9nd038nvotz9/AAD4tQ17MWwtR9mv2tyKx8tPa?dl=0

    ----

    Question 2 - what effects in PRISM won't work with Ortho camera?
     
    Last edited: Jan 19, 2017
    GoGoGadget likes this.
  18. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Regarding Q1, not that I'm aware of, but it's hard to tell exactly what the glitch is from that screenshot.

    Q2: IIRC, Ortho cameras struggle with depth-based effects. So AO, Fog, DoF, Godrays probably won't work, to name a few. Generally speaking, if the 'standard' Unity version of the effect works on ortho, the PRISM version will work as well.

    And mobile AO might be a cool idea (would have to be a separate thing ofc), what sort of AO would you be looking for? Feel free to PM me any screenshots, mainly for interest but who knows.
     
  19. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    In a current situation - any mobile optimised AO would be a buy it immediately asset)
    You can't be picky on an empty field)
    Jokes aside - the more options to tune its performance there will be, the better. For me it's the most important thing - to get an AO at a lowest computing price with the quality that won't make its use unreasonable.
     
    Last edited: Jan 21, 2017
    mcmorry and GoGoGadget like this.
  20. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    GoGoGadget, would you mind explaining the fog settings?

    I see that there parameters mostly have tooltips, so if you could confirm them (bold added by me)

    Parameter: Tooltip
    "Fog Start Point" "Distance away from the camera at which fog starts to occur"
    "Fog Start Color" "Color of the fog closest to the camera"
    "Fog Mid Point" "Distance away from the camera at which the mid color begins to blend in"
    "Fog Mid Color" "Color of the fog furthest to the camera"
    "Fog End Point" "Distance away from the camera at which the end color begins to blend in"
    "Fog End Color" None
    "Fog Distance" "Range in units that the fog takes to reach maximum intensity"

    I assume that the tooltip for the mid color is meant for the end color. The mid settings seem new.

    So otherwise can I just confirm though, first that all these distances are from the camera, and that the final one, "Fog Distance" is when the Fog End Color is fully reached, and "Fog End Point" is when the Fog Mid Color is fully reached, and up to "Fog Mid Point" it shows the Fog Start Color? That seems to be the upshot of those tooltips.

    And at distances up to the Fog Start Point, does it show no fog (alpha 0)?
     
  21. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Yep! They are distances from the camera. Only thing to note is, if you have a fog Distance of say 2,000, then a mid point of 1,500 and an end point of 1,800, then you will see the end color a bit (as the end color will start coming in at 1,800 and stop at 2,000).
     
  22. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Finally finished off the new version & will be submitting it to the store today - as well as a bunch of general improvements, PRISM's DoF has been reworked, and is now one of the most advanced, simple to use DoFs around (IMO).

    Previously, the MRT system in 2.0 had some issues, but after some tinkering, I've removed the need for Multiple Render Textures, so now the blur step is one fast pass, whilst also retaining the ability for near objects to blur 'over' objects that are in focus - it's a win/win.
    As well as that, I've taken a smart idea from Unity's new DoF, which now results in 'perfect' combination of blurred and non-blurred parts of the scene, whereas before, it wasn't 'clear-cut'. Now PRISM has the best of both worlds :)
    On:

    Off:


    Of course, if you don't use near blur, you don't pay for it either!
     
    jmjd, mcmorry and Shodan0101 like this.
  23. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Where is the "jaw drop emoticon"....? haha AWESOME!!!! ;D
     
    GoGoGadget likes this.
  24. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! Just bought it.

    Have a trouble. AO doesn't work at all.

    It renders it's texture but has no effect on a final output. Tried every option there is.

    See a video: https://dl.dropboxusercontent.com/u/81630687/prismAO.mov
    (Standard Asset's AO works, PRISM's not)

    That is frustrating.
     
  25. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi Shamsfk,

    Change the "AO Depth Method" to "DepthNormals" and it will work - Depth probably shouldn't be the default there, will change it in a future update. Thanks for bringing that up!
     
  26. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I tried that, and just now tried again. It has no effect, as any other option.
     
  27. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Can you Message me a screenshot of your editor when you tick "View AO Texture" with that option on? Never heard of that happening on all AO settings. Only other thing it could be is if you're forcing deferred rendering somewhere, or using an unsupported GL version (eg. Shader Model 2/GLES).
     
  28. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Last edited: Jan 24, 2017
    GoGoGadget likes this.
  29. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Quite hard to see the difference without an actual screenshot, it could be something simple like having your "Lighting Contribution" reducing the AO to 0 in all those lit areas.
    I'll PM you so we can work it out without spamming the thread.
     
  30. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Last edited: Jan 27, 2017
    GoGoGadget likes this.
  31. A_Savvidis

    A_Savvidis

    Joined:
    Jul 21, 2016
    Posts:
    98
  32. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    The initial issue ended up being the "AO Lighting Contribution" (under advanced options) was on 1.0 - which basically means that any lit surface (and some darker non-lit surfaces) doesn't get AO. If you set that to 0, you'll be able to see AO (make sure to also change depth texture settings - ie. if you're in deffered you should "Use Gbuffer").
     
  33. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I've run into the infamous keyword limit problem in my latest project and I see this thread littered with information on it. But I don't see anywhere where it says how many keywords are actually used by PRISM. Does anyone know the exact number?
     
  34. LordMortis

    LordMortis

    Joined:
    Jan 25, 2014
    Posts:
    27
    Hey there, we're trying to use prism on the PS4 and we're getting the attached errors when we try to compile.
     

    Attached Files:

  35. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hopefully should be a simple fix if they're the only errors - a function with a different name (that Unity's new cinematic image effects had better watch out for as well, as they have an "rcp" method) and a .cginc file that isn't needed. If you open up your PMs, I'll send you a version which should fix those!
     
  36. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Can i get a similar sharpen image like beautify?
    Look at the stairs
     
  37. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    PRISM 2.0 does now feature an amazing sharpening effect, yes! I obviously can't say if it can produce that exact result shown there in the picture (which actually could be achieved with a stronger normal map, and not a post-pro sharpen), but PRISM's sharpen is one of my favourite effects, as it's subtle, but gets rid of any unwanted micro-blur without oversharpening. It uses a smart luma-based sharpen algorithm that means it can be controlled with just one slider, so it's easier to use than Beautify's as well.
     
    Neo-Gamefactory likes this.
  38. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Can you show me a exampe of this, please? :)
     
  39. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Ahhhh :D is it support VR? :)

    Ah i see your start post with the mock VR :) this means, yes, i think :)
     
    Last edited: Feb 6, 2017
  40. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Hi

    We have little problem after build. It is difference between editor and build. In the build bloom and lens flares doesn't work properly. We dont have any error during build, only warnings and some warning are for PRIMS. Here is link for txt for warnings: https://dl.dropboxusercontent.com/u/52623513/PRISM/PRISM Build Warnings.txt
    Also right know when we put textures to lens flares, lens flares are not visible or very little, we tried textures in package.
    We using Unity 5.5.1f1 and last PRISM 2.0.4

    And here is screenshots:



     
  41. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Sure, is the best case for PRISM sharpening.
    Some effects in PRISM work in VR, but it is not officially supported, as I don't have a devkit to build on, and I've heard Unity's editor VR mode is still not 1:1 with actual HMDs. Most effects in PRISM should work in VR, only ones that might require special edge-case handling are depth-based effects like DoF or godrays.

    Thanks for those screenshots, I'll run some tests tonight but my initial thoughts are it could be shader-keyword related. When you are building the game, do you have lens flares and lens dirt checked as "on" in the PRISM inspector? If not, PRISM will optimize the build and strip out any effects that aren't ticked.
    If that doesn't fix it, maybe PM me your PRISM inspector, OS, and GPU and I'll see if I can get a repro going. It won't be related to those warnings, they're harmless but I should get around to removing them!
     
    Neo-Gamefactory likes this.
  42. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Holy S***, why is the second picture so blurry :D wow Amazing :)
    Is it a texture problem in the second picture or is it so blurry because of unity.. o_O it's so fantastic crispy and clear (your sharpener)

    I use trinusVR and my Smartphone for VR ;)
     
    GoGoGadget likes this.
  43. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Lots of things can affect texture clarity - in that screenshot for example, IIRC it's zoomed-in from 4K using one of the Unity image effects on DX9 that doesn't account for the DX9 half-texel offset (so everything gets a half-pixel 'blur' by default, vs PRISM which doesn't), and also PRISM's 'screen blend' bloom option is used, which again makes the textures clearer when using LDR +bloom thanks to a smarter combine method. Throw PRISM's sharpening on top, which is specifically tweaked to sharpen low-res textures, and you have a much sharper image. Jpg compression artifacts probably help PRISM in that case as well!
     
  44. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    @GoGoGadget - Just wanted to shared this with you for any possible input. A tester of my game "The Deep Paths" on iOS is getting this weird visual effect happening. He's running iOS 10.3 Beta 2 though, so I'm hoping it's a problem with the beta. Prism is the only post-processing stuff running in the game, so I just thought I'd share it in case it triggered anything in your mind :)

    http://www.stevejarman.com/temp/tdp_beta_issue.mov
     
  45. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hmm... Shouldn't be an issue with PRISM, I do know 2 other iOS games that use PRISM's bloom that haven't reported that issue (AFAIK of), but to be sure, could you export your version of PRISM that you're using as a UnityPackage and message it to me? I'll do a diff vs. current PRISM versions to see if it could be anything on my side.
     
  46. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Sneak peek time. Post-Process volumes coming next update!
     
    magique, chiapet1021, gurayg and 2 others like this.
  47. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    AWESOME!!!!!!!!! ;D
     
    GoGoGadget likes this.
  48. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    That is very cool! I have a little request for a similar functionality: can you make a script to blend PRISM presets at will (function call)? I would very much like to blend into some reddish blurry preset when player's health reaches 10% or to some shiny whitish one when uber heal spell is cast and back when it is done. Its not hard to salvage that from shown volumetric thing by myself but always better to have native)
     
    GoGoGadget likes this.
  49. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Actually, there already is, that's LerpToPreset in the docs/PrismEffects.cs :) LerpToPreset(PrismPreset preset, Time t) is what PRISM volumes use internally, next update it will be getting a few more overloads as well for extra control.
     
    magique and shamsfk like this.
  50. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Cool! Thank you, will look into it.
     
    GoGoGadget likes this.