Search Unity

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
    After a brief look at the Unity PostProcessing Stack v2, I don't see why anyone would need to write a custom effect to 'plugin' to it when it doesn't actually seem to 'plugin' at all, it just lays on top or below of the actual stack. You can already achieve this by moving the component up or down in the inspector or adding the [ImageEffectOpaque] tag onto it.
     
    yc960 likes this.
  2. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    Why "godrays" effect has been removed? :(
    Can you recommend some alternative solution to make such effect?
     
  3. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Godrays were deprecated to make way for other features in PRISM. If there is enough demand, I can look at some newer, fancier methods to do them properly. For now, Unity's old image effect godrays are quite similar.
     
    Shodan0101 likes this.
  4. DAMANStudios

    DAMANStudios

    Joined:
    Jul 14, 2017
    Posts:
    8
    Hi,

    I have an error with PRISM 2.2.1 in unity 2017.1.0f3
    (1) Prism is not supported on this platform, or you have a shader compilation error somewhere.
    UnityEngine.Debug:LogError(Object)
    PrismEffects:CreateMaterials() (at Assets/PRISM/PrismEffects.cs:1244)
    PrismEffects:OnRenderImage(RenderTexture, RenderTexture) (at Assets/PRISM/PrismEffects.cs:2120)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    When I enable PRISM component, nothing change, if anyone can help me :/ (I try to reimport the asset, but still have this error)

    Thanks in advance !
     
  5. GoGoGadget

    GoGoGadget

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

    Will check that out for you! Just to confirm, you're using the latest version of PRISM from the asset store?
     
  6. cheeze_12

    cheeze_12

    Joined:
    Aug 25, 2017
    Posts:
    3
    Hey, so I had the same problem and what I did to fix it is simply go into the "shaders" folder and right click -> reimport on all the shaders that were in there :)
     
    GoGoGadget likes this.
  7. DAMANStudios

    DAMANStudios

    Joined:
    Jul 14, 2017
    Posts:
    8
    Yeah I have the version 2.2.1, thank you !

    Hey, thank you very much for your answer but for me it doesn't work :/ I still have the same error with an other error :
    Shader error in 'Hidden/PrismEffectsTertiary': undeclared identifier '_MainTex_ST' 'UnityStereoScreenSpaceUVAdjustInternal': cannot implicitly convert from 'float2' to 'float4' at Assets/PRISM/Shaders/Prism.cginc(550) (on d3d9)

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA
    and many other errors like that :S
     
  8. Ruben_Chris

    Ruben_Chris

    Joined:
    Mar 10, 2013
    Posts:
    94
    Hmm. I'm having some problems creating a build and I get the following errors:

    Shader error in 'Hidden/PrismEffects': Program 'fragFinal', error X4510: maximum number of samplers exceeded. ps_3_0 target can have a maximum of 16 samplers (on d3d9)

    Compiling Fragment program with PRISM_USE_STABLEBLOOM PRISM_HDR_BLOOM PRISM_USE_DOF PRISM_GAMMA_LOOKUP PRISM_USE_EXPOSURE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA

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

    Compiling Fragment program with PRISM_USE_STABLEBLOOM PRISM_HDR_BLOOM PRISM_USE_DOF PRISM_GAMMA_LOOKUP PRISM_USE_EXPOSURE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA


    I'm using Unity 2017.1.0f3 Personal.
    It won't build my game at all, so it's become a problem for me :)
     
  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hey Ruben,

    Replied to your email with a few more details, let's get this fixed for you soon!

    Hey Paraneuf,

    Will take another look at that tonight for you! If possible, sending a repro case over to support@gadget-games.com would be great, but not required.
    Edit: Have just tried to replicate it, no luck - everything builds correctly in the demo scene on 2017.1.0f3 for me after a fresh asset store import. What Graphics API are you using, and what effects?
     
    Last edited: Aug 28, 2017
  10. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    Hello guys!
    Wanted to ask you, as I am now considering to buy this asset, what are the advantages to the post processing stack from the Unity guys themselves? apart from some extra effects, the ones that both of those have, where do the differences lie?
    also wanted to ask, whether the asset plays nicely with mobile, or at least is as performant as the post processing stack.
    And the post processing volumes this asset has, are they beta or ready to use?
     
  11. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi Endi,
    I'm happy to answer, of course I'd also encourage you to read everyone else's opinions. So:
    1. PRISM v Unity
    • PRISM across the board has more performance options. Basically this means you can make PRISM faster if you want it faster.
    • Many effects in Unity's Post-Pro stack are not designed for mobile, simple as that. They do things like whole colour-space conversions from sRGB to ACES and back again that (sort of) make sense for higher end platforms like desktop, but are a waste of GPU time on mobile.
    • Different looking, and flat out different effects. PRISM's bloom has lens flares. PRISM's dither looks different (and better in most use cases, IMO). PRISM has an amazing sharpen effect.
    • There is nothing wrong (on desktop) with using Unity's Post-Pro stack for their TAA and Motion Blur, then using PRISM for everything else. I do that with my game, as TAA+Motion blur can't really stack with anything else anyway, and I prefer PRISMs other effects + higher performance.
    2. Mobile
    • Yes, PRISM plays very nicely with mobile and has mobile-friendly options
    3. Post-Processing volumes
    • They are simple (ie. no fancy callbacks on them or anything) but work well.
     
  12. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    Thank you very much for the reply, will definitely pick it up next time it goes on sale.
    As I've noticed, Prism doesn't have an Anti-Aliasing solution.
    I have to use Unity PPS for that?
     
    GoGoGadget likes this.
  13. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Yep, as Anti-Aliasing can't be combined, there's not really much point having it in PRISM when there are already decent solutions out there like Unity PPS. I use Unity's AA with PRISM in my game, really need PRISM's sharpen when you use their TAA though!
     
  14. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    If I enable AO, and have a world space canvas UI in front of the object, I can see its effect through the UI/canvas.
     

    Attached Files:

  15. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Go into PRISMEffects.cs and add in the [ImageEffectOpaque] tag before the OnRenderImage function to fix this (as per the PRISM guide). Actually working on a more permanent fix as my game requires it as well, means less perf but 'just works' in all scenarios.
     
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    A reason for implementing with the 2.0 stack would be to support the PostProcessingVolumes in the stack. By using the built in property types values will automatic interpolate between volumes.
     
    GoGoGadget likes this.
  17. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    I see, makes sense. Will definitely have a look at it sometime.
     
  18. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I upgrade to the latest PRISM today and when I compile for the Wii U I get the following error:

    Shader error in 'Hidden/PrismEffects': GLSL vertex shader: (85): ERROR: '' : 'UnityStereoScreenSpaceUVAdjust' already defined
    (on wiiu)
    Compiling Vertex program with PRISM_GAMMA_LOOKUP PRISM_USE_EXPOSURE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP

    Any ideas on how to fix this?

    [EDIT]
    I fixed it by commenting out the following code in Prism.cginc.

    Code (CSharp):
    1. //    #ifdef UNITY_SINGLE_PASS_STEREO
    2. //        #define UnityStereoScreenSpaceUVAdjust(x, y) UnityStereoScreenSpaceUVAdjustInternal(x, y)
    3. //    #else
    4. //        #define UnityStereoScreenSpaceUVAdjust(x, y) x
    5. //    #endif
    6.  
    But I have no idea why I would need to do that.
     
    Last edited: Oct 15, 2017
    GoGoGadget likes this.
  19. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Will look into this, thanks for the report!
     
  20. Adam2Marsh

    Adam2Marsh

    Joined:
    Mar 2, 2014
    Posts:
    5
    Hiya Guys,

    Just wanted to add I experienced the same issue as magique when trying to build for Android on the latest version of Unity. Using his fixed worked for me after restarting Unity.
     
    GoGoGadget likes this.
  21. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Endi24 and Acissathar like this.
  22. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    Nice! Just as I was waiting for a sale for this asset, I might just win it for free! #RT
     
    GoGoGadget likes this.
  23. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Shodan0101 and Endi24 like this.
  24. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    Wanted to ask a quick question: when will the 2.4 version be available? As the current Chromatic Aberration of post processing stack is giving me some serious artifacts. Oh, and btw, thanks a lot for selecting me as one of the giveaway winners :)
     
  25. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    The Asset Store are usually pretty fast at approving updates - I'd say by start of next week at the latest. (and I think I know what you're talking about, the PostFX stack aberration has always promised more than it delivers IMO)
     
  26. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    PRISM 2.4 is now live on the Asset Store! Make sure to update to get the newest fixes and chromatic aberration features.
     
    Endi24 likes this.
  27. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    After seeing a recent string of posts by some other graphics programmers on Twitter about post-processing using a full-screen triangle instead of a quad (2 triangles) I was inspired to see how it impacted PRISM, and went ahead to implement it (very easily actually).

    To give a bit of context, the reason why it matters is the way the pixel shader executes 'across' the two triangles of a full-screen quad. Basically, you lose some locality (and GPUs love locality) across the middle, as shown here on an AMD GCN card (source: https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/):


    So I implemented full-screen triangle blits in PRISM. These results are very very early, but I did see a bit of an uplift (and a more stable frame time, ever so slightly) in the PRISM demo scene when all of PRISMs Blits used the full-screen triangle instead of the quad:

    Full-screen Triangle - 44fps @ 4k

    Full-Screen Quad/Graphics.Blit: 41fps @ 4k
     
    TeagansDad, magique and mahdi_jeddi like this.
  28. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Hi,

    I upgraded to version 2.4 and now I get a whole bunch of errors. Line 1249 of prismeffects.cs

    PRISM is not supported on this platform or you have a compilation error somewhere.

    It freezes my Unity 2017.2 on Windows.

    Any idea what changed in this version that might cause this?

    Thanks!
     
  29. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I have a trouble using PRISM with AQUAS water shader.

    AO doesn't work correctly (doesn't distort underwater), while Unity's AO works fine, please see a screenshots comparison:

    https://imgur.com/a/aJZsV

    Can it be fixed?
     
  30. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Will download Unity 2017.2 to find out! No real reason it should break unless Unity changed something, but who knows. I'm currently using 2017.1 as my primary test build.

    This is due to how PRISM's AO is combined - as with anything else transparent, you will see this when using PRISM's AO + DoF, as per the PRISM Manual. The workaround if you really want to use PRISM's AO with that sort of scene is also in the manual, add an [ImageEffectOpaque] above OnRenderImage().
     
    shamsfk likes this.
  31. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    An update on this: I have confirmed there is no issues with PRISM in 2017.2 on my setup (https://gfycat.com/gifs/detail/DependentSlimyDodo) - what you have is a general shader compilation error somewhere in one of your other shaders that is stopping PRISM (and other shaders) from compiling. Let me know how you go with that, usually it's something small.
     
  32. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    I am still investigating this. After I import, it seems to throw these errors only after I load a scene that was using Prism. I tried removing Prism form my scenes then upgrading it after that. Then I get Shader error in "Hidden/Prism Effects": Can't force branch with gradients on non-input at Assets/PRISM/Shaders/Prism.cginc(1876) (on d3d9)

    Does it not support DX9? Or is this a compilation thing?
     
    Last edited: Nov 25, 2017
  33. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Ah! I switched to DX11 and it works again. Does this mean that you dropped DX9 support in this version?
     
    GoGoGadget likes this.
  34. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    I can't think of anything that prohibits DX9 in 2.4, it's probably some small #ifdef that got commented out or something like that. Will re-test for the next version and make sure it passes on DX9, PM me if you need the DX9 fix earlier!
     
  35. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    PRISM is on sale for 30% off on the Asset Store Mega-Sale! It's a fantastic time to grab PRISM with some new cool stuff like FS-triangle blits coming up: http://u3d.as/mrJ
    PRISM_2_Gif.gif
     
  36. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I'm having trouble with Fog. I'm using linear deferred. For below some fog distance value is just solid color, and after some value is just not visible at all. its on or off and on means solid color, all types are the same.
    Forward mode is the same.
     
  37. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Do you want to send me a screenshot of your inspector (and PRISM version#) and the result when using fog? It does use values from your camera to base the distance off, so needs a bit of tweaking sometimes. I'll take a look into what it might be in your case though, that doesn't sound right.
     
  38. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Just a bump to remind everyone that PRISM can be used efficiently on mobile as well as other platforms! I've had a few users recently say they hadn't considered PRISM for their mobile project due to thinking it was desktop only. As of PRISM's latest update, it's never performed better on mobile, and you can get brilliant looking Bloom, Vignette, Tonemapping and Color Grading on a huge range of devices :)

    Also, here's a test one user did using a mobile setup for PRISM, vs another mobile PostFX stack on the Asset Store with equivalent settings (guess which is which!):

     
  39. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    That looks awesome!!! :D
     
  40. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Second image with over bloom leaking everywhere is Prism ?
     
  41. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    How'd you guess? ;) (but seriously, #1 is PRISM).
     
  42. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You can have the same subtle bloom with the new Unity post process stack changing settings.
    I own already Prism i baught long time ago, is there some real advantages about using Prism instead of Unity stack ?
     
  43. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Yep, PRISM works much better for mobile, and for desktop gives a different look to the Unity stack. You know how many recent high profile non-AAA UE4 game looks very same-y? IE. Ark, PUBG, Conan, Battalion1944) - that's because they all use the built-in post-processing. Exact same with Unity - if everyone were to use the default Unity stack in their game, you can pinpoint it's Unity as soon as you open it. That doesn't mean your game looks worse with Unity's stack - it just makes it harder to look unique.
     
    zenGarden likes this.
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Because they didn't tweaked a lot the stack.
    There is other games made in UE4 made looking very different because they use specific settings or the author written a specific render shader.

    UE4 is a bit different as it has very specific post process, for example normal maps usage with lighting is different from Unity.
    But in theory you could achieve the same look as Prism considering Unity post process stack has all components to change colors, contrast, tonemapping etc ...
     
  45. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Color correction and tonemapping are two of the most generic algorithms in any stack, so yes - if you used basic ACES tonemapping, and a color correction LUT on both the PRISM stack and Unity's, you could make the result look indistinguishably similar from each other. Even then, you could use PRISM's unique RomB tonemapping, (which Unity doesn't offer) for a different look.

    But look at just about any other effect, and you'll see each is unique. Unity's chromatic aberration has been a trademark of every one of their recent demos - look for the extremely strong edge blur (stronger than in any camera lens I've owned, even old Russian ones) and purple fringing. That's how Unity's ChromAb will always work. Say you wanted to replicate a lens that has stronger aberrations around the whole frame, without corners as blurry as that, and a red/blue split instead of purple fringing - that is what PRISM offers.

    Again, let's take DoF as an example - if you want super tight cutscene DoF - I've always said to use Unity's - simple as that. If you want far-field DoF to simulate a near-infinity focus on a, say, 30mm lens, PRISM's is going to get you a lot closer to that sort of look.

    At the end of the day, all a Post-Processing stack is is a set of parameters that you can use to fake the effects of a lens in a game engine (with some CC and other game-specific as well). There will never be such a thing in any game engine as a stack that can simulate any lens that has ever been made, and as long as each uses different algorithms (like PRISM, Beautify, formerly Scion) they will be a valid option to add a different look to your game.
     
  46. Despellanion

    Despellanion

    Joined:
    Mar 18, 2015
    Posts:
    19
    I'm having some issues with Prism AO + Unity's standard Global Fog. When I have them both enabled, the AO seems to be visible through solid walls for objects behind, like a depth artifact.
     
  47. GoGoGadget

    GoGoGadget

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

    Due to how PRISM's AO is combined to save performance, this is expected behaviour when using another fog effect - but you should be able to use PRISM's fog and PRISM's AO together without artifacts. For a workaround if you really need to keep using Unity's fog, adding [ImageEffectOpaque] above OnRenderImage() in PrismEffects will change it so PRISM's full stack is combined after transparents.
     
  48. Thelo

    Thelo

    Joined:
    Sep 13, 2009
    Posts:
    98
    Hello, this shader error is still happening as of the latest version of Prism (downloaded last Friday). Edit: It's erroring in DX9 mode, but not on DX11.
     
    Last edited: Feb 6, 2018
  49. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Hi, I noticed today that when Image Effects are turned on on the scene view in the editor, even when not in play mode, PRISM has a material leak. I stepped through PrismEffects.cs OnRenderImage with a debugger, and I'm not exactly sure why, but every frame in OnRenderImage when it calls CreateMaterials(), all the member materials are null, so it recreates all of those materials, but then never deletes them. Maybe the editor view creates a new temp copy of the PrismEffects component every frame which never gets disabled, so it doesn't do the OnDisable part where it deletes the materials?
    Turning off image effects in the scene view stops it from generating more materials, but the existing materials never get removed, not even with a call to Resources.UnloadUnusedAssets or when closing the scene. Here's a screenshot of the profiler showing the material count, that's pretty much all copies of the Prism materials. If the editor stays open long enough the memory leak will cause it to crash. I'm on Unity 2017.3.0p2.

    upload_2018-2-5_15-7-15.png
     
  50. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Ah, found the issue. For a quick fix, go to the line where the error spams, it will have:
    Code (CSharp):
    1.             #if defined(UNITY_COMPILER_HLSL)
    2.             [branch]
    3.             #endif
    And just delete the [branch] line. It will then work. Will make sure this makes it into the next update (which is still pending some VR stuff.

    Very weird - haven't experienced this myself but also not on 2017.3. Will investigate, thanks!