Search Unity

[RELEASED] Cinematic URP Post-Processing - The Power To Create

Discussion in 'Assets and Asset Store' started by GoGoGadget, Apr 15, 2021.

  1. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Good morning all,

    Very excited to share a project I've been working on since 2020. Cinematic URP Post-Processing is a new postprocessing stack I've developed, to be the go-to solution for high-end post-processing in URP. As of today, it is now live in the Unity Asset Store, I welcome all feedback in this thread. Previously, I have worked on PRISM, which has been used in released Unity games on every major platform over the course of the last 4+ years since its release and continued updates.

    What Is It?
    Cinematic URP Post-Processing is designed from the ground-up to achieve beautiful, fast, AAA-quality post-processing for games built with Unity using the Universal Render Pipeline. Currently supporting, over 20 cinematic effects, such as Petzval Distortion, which closely mimics the famous "Helios-44" lens' distortion pattern, and allows for a 'Cat-Eye' bokeh effect, not currently offered by any other asset.

    Why make it?
    Unlike other post-processing assets, Cinematic URP Post-Processing is optimized specifically for the Universal Render Pipeline resulting in improved performance compared to equivalent effects ported from older rendering pipelines.

    Why is it better than x?
    CUPP is meant to be an asset for those who want their game to look different - without the telltale signs of Unity's builtin SRP effects, while maintaining a high level of performance.




    Effects:
    • Color Temperature & Corrections
      PRISM’s Color Correction performs LAB-space operations on the scene colour, retaining maximum color data for a result that works perfectly in HDR and Linear colour spaces. Designed based off modern RAW photo editing algorithms.
    • Color Tint
    • Exposure Compensation
    • Color Vibrance
    • Contrast
    • LAB Chromacity
    • Sloped Brightness
    • Shadows, Midtones & Highlights (SMH) Adjustment
    • Dual Color Correction LUTs
    • HDR Bloom (With Stability Buffer)
      Simulates light scattering within a lens. In a real-world lens, this can occur because a lenses’ coating has been scratched, or internal surfaces of the lens are dispersing the light.
    • Vignette
    • Lens Fringing & Distortions
      Simulates imperfections of a photographic lens. Chromatic aberration (ie. when wavelengths of light do not perfectly converge on the sensor), Barrel distortion (wide angle, pincushion distortion), Petzval distortion (ie. like that found in certain lens designs, like the Helios-44).
    • Barrel Distortion
    • Petzval Distortion
    • Chromatic Aberrations
    • Filmic Noise
    • Dither
    • Tonemapping
    • Gamma Adjustment
    • Depth of Field with GPU-Autofocus
      An effect simulating out-of-focus areas caused by light from the camera lens not converging on the focal plane of the sensor.
    • Double-pass Sharpen
      A photographic sharpening effect, based off real-world sharpening algorithms used in photo editors. Increases perceptual contrast in the image.
    • Directional Localized Anti-Aliasing (DLAA)
      An effect used in many AAA games, DLAA is a classic Full-Screen Anti-Aliasing effect (antialiasing reduces the jagged appearance of thin lines) that performs well when rendered prior to the post-FX stack. The effect closely mimics the sort of AA filter found on a camera sensor, which is why it is used at the start of the PRISM stack, instead of after all other post-processing is complete. It is designed to work with other AA effects, including Unity’s builtin.
    Showcase:

    Chromatic Aberrations


    Bloom & Bloom Stability





    CUPP On, ft. Lens Distortions:

    CUPP Off:


    Purchase CUPP on the Asset Store today for $10:
    http://u3d.as/2sUf
     
    Last edited: Feb 18, 2024
    apkdev likes this.
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    NEW UPDATE - "THE SUNSHAFT UPDATE"

    As of today, Unity has approved CUPP's first major update. Very excited for this one, and the wealth of great changes it brings. The focus of the update is on mobile performance & compatibility, and the introduction of a new CUPP effect, Screen-Space Atmospheric Scattering (Sunshafts).


    Full patchnotes below:
    Added Screen-Space Atmospheric Scattering (Sunshafts) effect
    -Sunshafts works on all platforms that support depth textures
    -CUPP’s Sunshafts use a custom-built, 16-tap native resolution implementation, that achieves a full-screen sunshaft for only 16 texture samples. Through the use of interleaved gradient noise to jitter the texture samples, and a custom de-stepping blur as the final pass, the effect is able to achieve perfectly stable, pixel-perfect shafts that respect the scene depth, while being performant enough to run on mobile devices.

    Mobile Optimizations and fixes

    -Fixed compilation error on Android builds using Vulkan or GLES3
    -Fixed bloom spread value not affecting mobile bloom
    -Now, the recommended setup for Bloom when targeting any mobile device is to disable Bloom Stability, High Quality Bloom, and Lens dirt. This will ensure CUPP’s custom, mobile-optimized and tested bloom will be active

    Bugfixes and improvements:

    -Fixed a bug where some settings of Bloom would cause the bloom effect to not enable at all
    -Decreased compile time by ~60%
    -Removed unnecessary shader keywords
    -Bloom spread value is now a float, not an integer
    -Fixed a shader reference issue that could result in a compile error upon importing


    Off/On Comparison:
    GodraysOff_1.png GodraysOn_1.png
     

    Attached Files:

    apkdev and Acissathar like this.
  3. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    How does this asset compare to the performance of regular Unity URP post processing?

    Is it compatible with Nintendo Switch?
     
    GoGoGadget and apkdev like this.
  4. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    It is compatible with Nintendo Switch, all URP platforms are officially supported by CUPP.

    Regarding performance vs. Unity's inbuilt effects, I'll put together a table in the next ~week that shows some detailed performance stats. One thing to note is that CUPP offers a number of different effects (Petzval distortion, DLAA, Sunshafts, Sharpen, Secondary LUT) that aren't available in the default stack, so a 1:1 comparison isn't really possible. Are there any effects in particular you would be focused on for a comparison performance-wise?
     
    Rich_A likes this.
  5. dark_vulcan

    dark_vulcan

    Joined:
    May 23, 2020
    Posts:
    7
    Does it support VR? Sing pass instanced ?
     
  6. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    It should, but I do not have any devices to certify that on, if you're interested in testing it, I can DM you a version to confirm yourself.
     
  7. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    A new update for CUPP is now live! Included in this update is a highly optimized full-screen blur effect, perfect for mobile and great for making something like a pause menu blur. As well as that, CUPP's DoF has been heavily optimized with a new mobile-friendly option for it, sunshafts performance has improved (and noise). As always, check the patchnotes on the Asset Store for the full details.

     
  8. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Any updates on the performance table? :)
     
  9. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Apologies for the delay, but I have just finished it!

    For those interested, you can find it here - https://docs.google.com/spreadsheets/d/1r1znz5NU5IZT5Ies5CsO2hrVlyjHcj6bzjAiwNu-xh8/edit#gid=0 - I'll keep it public and continue to update the numbers with new effects as they get added to CUPP. These are the raw numbers recorded from a built Unity executable on Windows, run on DX11 with my AMD Fury X GPU. I have kept in everything, even the numbers which may not look favourable for some effects (ie. DoF) because I am using this public document as my own internal performance tracker between versions now, so I need the numbers to be real.

    Some scenarios where CUPP was faster than Unity built-in in my initial test:
    • CUPP was faster than Unity's bloom (181fps vs 179fps)
    • CUPP's DLAA was faster than Unity's builtin FXAA (208fps vs 199fps)
    • CUPP's new fullscreen blur was faster than Unity's Gaussian DoF equivalent (194fps vs 184fps)
    Now, I would like to give a bit of a disclaimer in that this is far from a scientific test, so far conducted just on my machine.

    Also, you may notice some irregularities, ie. Unity's Color Correction running 2% faster than no effects at all. That is because in URP, any time you use Post-Processing, Unity forces their final pass (which is a LUT + Tonemap) onto you - even if it does nothing. If you make the tweak to the SRP and remove that, then I can pretty much guarantee that CUPP's LUT implementation will be faster than Unity's.
     
  10. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    I was a little bit underwhelmed and couldn't see much difference against the base URP effect stack.

    Turning on sunrays turned my camera renderer black (2021.1.11).

    The major use was Sharpen, since URP doesn't have it, but I can get standalone sharpen assets.

    The cost is not the issue, I'd rather pay $100 for an awesome post-processing stack than $10 for something I won't use (I have a high bar for the assets I'll add to a commercial project).

    However compared to Beautify 2, the asset was pretty easy to setup, it just needs more features and development, and a higher price.
     
  11. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Thanks for the report, that Sunshafts issue has been fixed and will be in the next update.

    Definitely understand, having worked on commercial projects myself, that the bar for assets to make final builds can be quite high, so feedback from developers like yourself is crucial to improving the asset. Are there any particular features you felt were needed for it to make the cut in your use case(s)?
     
  12. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    A selection of about 20-30 LUTS (with the name 'LUT' somewhere in the filename) would be good.

    Film grain with the ability to control jitter (URPpp lacks jitter control)
     
    GoGoGadget likes this.
  13. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Hello there!
    I downloaded CUPP and am having a weird issue: when the Sunshafts rendering feature is added, my UI has a weird planar reflection effect. Kinda cool, but not what I'm going for. If I remove that one, it goes back to normal.
    Any ideas? Is this a bug?

    Also, I want to mimic a real, physical camera as best as possible, and CUPP seems like a great way to do that. But, I was wondering, is there a way to create the effect of exposure/ISO using the asset? Similar to what HDRP does.
    Thanks!
     
    GoGoGadget likes this.
  14. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi! I'll DM you the version of CUPP with that Sunshafts fix - it's currently waiting asset store approval.

    Regarding exposure/ISO, absolutely. CUPP has an exposure slider, and this can be coupled with noise to emulate a certain exposure. Now, while it is technically possible to do your own auto-exposure algorithm, that isn't built into CUPP as a checkbox at the moment - if that's a feature that you're after, I can look to prioritize it for the next update, let me know!
     
  15. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Cool, thanks so much!
    I'm not too well versed in cameras, but am fascinated by the idea of replicating one in Unity.
    I don't care too much for auto-exposure, I really just want to mimic setting the ISO of a camera.
    Would you be able to add a single slider for ISO that does the automatic coupling of exposure and noise with the correct ratio? (If there is one!)
    Thanks so much, amazing job with this!
     
  16. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Also, how would you recommend we adjust the properties at runtime?
    Thanks!
     
  17. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Makes total sense! I can do that, I think I might actually implement it as a callable function via code as well, in case anyone wants to setup their own ISO runtime effects. It will be an implementation based on my own experience as a Nikon full-frame shooter, since of course every real-life camera & sensor have their own individual processing & ISO/noise.

    Here's a script that shows you how to do it, it's fairly simple as CUPP uses standard Unity Post-Processing volume semantics. Just pick what you want to change and go for it:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Rendering;
    5. using UnityEngine.Rendering.Universal;
    6. using UnityEngine.Rendering.Universal.PostProcessing;
    7. using PRISM.Utils;
    8.  
    9. namespace PRISM.Utils {
    10.  
    11.  
    12.     public enum PostProcessPropertyToChangeType { Exposure = 1, ColorTemp = 2, Nothing = 3 };
    13.  
    14.     public class CUPPRuntimePropertyAdjuster : MonoBehaviour
    15.     {
    16.         private PRISMEffects targetCUPPEffectsToChange;
    17.         private float t = 0f;
    18.         private float lerpSpeed = 1f;
    19.  
    20.         private float originalExposure = 1f;
    21.         private float originalColorTemp = 1f;
    22.  
    23.         public PostProcessPropertyToChangeType propertyToChange = PostProcessPropertyToChangeType.Exposure;
    24.  
    25.         private void Start()
    26.         {
    27.             Volume volume = gameObject.GetComponent<Volume>();
    28.             PRISMEffects tmp;
    29.             if (volume.profile.TryGet<PRISMEffects>(out tmp))
    30.             {
    31.                 targetCUPPEffectsToChange = tmp;
    32.             }
    33.         }
    34.  
    35.         // Update is called once per frame
    36.         void Update()
    37.         {
    38.             t += Time.deltaTime * lerpSpeed;
    39.  
    40.             if(t > 1f)
    41.             {
    42.                 lerpSpeed = -1f;
    43.             }
    44.  
    45.             if(t <= 0f)
    46.             {
    47.                 lerpSpeed = 1f;
    48.             }
    49.            
    50.             if(propertyToChange == PostProcessPropertyToChangeType.ColorTemp)
    51.             {
    52.                 targetCUPPEffectsToChange.colorTemperature.value = originalColorTemp * t;
    53.             } else if(propertyToChange == PostProcessPropertyToChangeType.Exposure)
    54.             {
    55.                 targetCUPPEffectsToChange.exposure.value = originalExposure * t;
    56.             } else //Nothing
    57.             {
    58.                 targetCUPPEffectsToChange.colorTemperature.value = originalColorTemp;
    59.                 targetCUPPEffectsToChange.exposure.value = originalExposure;
    60.             }
    61.         }
    62.     }
    63. }
    64.  
    That will give you this:
     
  18. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    That sounds amazing, and I like to hear that it's based on your own experience with real cameras :)

    Also, thank you for the code sample, I will mess around with that later!
     
  19. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Sorry to be asking so many questions, but since Importing the asset, I've noticed other issues with the UI. I think the main problem is that the entire canvas is receiving the post effects in addition to the scene. My UI canvas is set to Overlay, and I am getting tonemapping and bloom changes to on-screen UI elements, which isn't ideal.
    Maybe some projects might need it, but it's getting really frustrating for mine. Is this intentional? A bug?
    Thanks so much for your continued help!
     
  20. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    No worries! That definitely shouldn't happen - CUPP doesn't do anything different to Unity's builtin processing in that regard, and I can't reproduce it - two things to check;
    1. Are you sure your UI is not set to Camera?
    2. What layer is your Post-Process profile on?
    Here is an example (using the current Asset Store version of CUPP) of what should/does happen (UI not affected by Post-Processing unless it's rendered via Camera):
     
  21. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    After a restart, the issue was fixed. Super strange!
     
    GoGoGadget likes this.
  22. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Exciting update in the works! Have taken the last few weeks to work on a number of improvements and features, to start off with in the below screenshots are CUPP's new (optional) highlights-weighted bloom thresholding method, and new noise controls (including separating noise from dither, adding in new per-channel R, G, and B noise values, and noise animation).

    Will be sharing the other improvements over the next few days, and am aiming to get this new major version to the asset store after final testing this weekend!

    CUPP Off:

    CUPP On:
     
    oleg_v and JudahMantell like this.
  23. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Hello!
    Thanks for the asset, but i can't get Sunshafts to work.
    Checked other effects, all fine except sunshafts, they just do nothing independently of settings.
    I'm using URP 10.5.0.

    Last try gave me gray scene screen and the following in console:

    Code (CSharp):
    1. MissingReferenceException: The object of type 'RenderTexture' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. PRISMEffects_URP.Render (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RenderTargetIdentifier source, UnityEngine.Rendering.RenderTargetIdentifier destination, UnityEngine.Rendering.Universal.RenderingData& renderingData, UnityEngine.Rendering.Universal.PostProcessing.CustomPostProcessInjectionPoint injectionPoint) (at Assets/Cinematic URP Post-Processing/Scripts/PRISMEffects.cs:895)
    4. UnityEngine.Rendering.Universal.PostProcessing.CustomPostProcessRenderPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Assets/Cinematic URP Post-Processing/Scripts/CustomURPPostProcessing/Runtime/RenderFeatures/CinematicURPPostProcessing_PRISM.cs:363)
    5. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteRenderPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.ScriptableRenderPass renderPass, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/ScriptableRenderer.cs:731)
    6. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteBlock (System.Int32 blockIndex, UnityEngine.Rendering.Universal.ScriptableRenderer+RenderBlocks& renderBlocks, UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData, System.Boolean submit) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/ScriptableRenderer.cs:705)
    7. UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/ScriptableRenderer.cs:561)
    8. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.CameraData cameraData, System.Boolean anyPostProcessingEnabled) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/UniversalRenderPipeline.cs:390)
    9. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/UniversalRenderPipeline.cs:300)
    10. UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Camera[] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@10.5.0/Runtime/UniversalRenderPipeline.cs:255)
    11. UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[] cameras) (at <127e81e1cb3441cc97d26b1910daae77>:0)
    12. UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <127e81e1cb3441cc97d26b1910daae77>:0)
    13. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    14.  
     
  24. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Finally got it worked!

    Previous problem solved by restarting Unity :)

    What is needed for Sunshafts (except steps from guide) is to add PRISMSunshafts to "After opaque and Sky" phase to ForwardRenderer.

    Perfect!
    GoGoGadget, thank you!

    CUPP-report.png
     
    GoGoGadget likes this.
  25. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Fantastic looking scene!

    I'll add that to the CUPP guide as a troubleshooting step for people experiencing the same issue
     
    oleg_v likes this.
  26. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Cinematic URP Post-Processing's new 4.1 update is now live!

    After feedback from @Rich_A, CUPP's LUT suite has been overhauled, and now features over 100 4K HDR LUTs inspired by classic film. Check out the trailer below:



    As you can see - LUTs aren't the only thing new - CUPP's editor has improved, and now lets you cycle through LUTs, even your own, automatically - as long as they follow the naming convention and start with "CUPP_LUT". I'm hoping this will make iteration time a lot faster for everyone - no-one likes the painful game of dragging-and-dropping across a 4K screen into a tiny editor window, so now you can see what a change of LUT would look like with one click!

    As well as LUTs, the 4.1 update includes a new bloom highlights mode option, which more closely resembles what those coming from default Unity PostPro are used to. Gradual highlights are still the default.

    On top of that, a number of changes have been made to CUPP's colour pipeline, including the internalization of "Linear" mode, and improvements to exposure correction (which now affects bloom).

    You'll also find a reworked noise engine - now with per-channel R,G,B noise control, and noise line animation options, with increased performance compared to previous versions after a few bugs were fixed.

    Pick it up on the asset store here: http://u3d.as/2sUf
     
    PutridEx and Rich_A like this.
  27. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Hey @GoGoGadget, fantastic work!
    I noticed that there's a "Long Exposure" post effect with no documentation (and seemingly little to no effect on the camera). It looks interesting, and I was wondering if you could shed some light on it?

    Also, I apologize for bringing this up again, but I just got around to messing with the Exposure correction slider, and it works great, but I'm a little confused as to what metric this value (-5 to 5) is being measured in. Is it a general value being used, or is it measured in some unit? I hope that makes sense!

    Thanks!
     
    GoGoGadget likes this.
  28. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Ah, thanks for catching that! It seems the alpha of the long exposure effect I've been working on slipped into the last Asset Store build - that effect is designed to mimic the "Live ND" feature of some cameras that in effect, makes a long exposure from blending multiple shorter exposures together. It should be complete by the next version, and I'll be sure to include some more in-depth examples of how it can be used (the easiest one that springs to mind is as an 'on-hit' effect, say you're making a game with melee combat, you could enable the effect when your character gets hit with a low value to simulate a sort of 'dizziness' without it looking exactly like motion blur.

    Re: Exposure, good question, the -5 to +5 is intended to be EV (Exposure Value) - which on most modern cameras actually goes from -3 to +3. It's using that value for some (hopeful) familiarity for those who have worked with digital cameras before, as +1 EV on an image in CUPP should give the same results as +1 EV on the same image using a RAW photo editor software.
     
  29. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Ah, I understand, thank you for the detailed explanation!

    On an unrelated note, I was messing around with the built-in motion blur and was somewhat unhappy with the results. I think a CUPP version of motion blur might also be an interesting feature request, taking into account a simulated shutter speed, rather than just an abstract "intensity" slider with no "real" equivalent. But for all I know that could be beyond the scope of the asset. Just figured I'd mention it! :D
     
    GoGoGadget likes this.
  30. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Hey there!

    we just recently started using CUPP, and have been absolutely loving it so far! We did run into two issues that we couldn't find addressed here (sorry if these have been mentioned previously, and we just didn't find them).

    1) When switching scenes, PRISM Effects throws a nasty exception that can only be removed by restarting Unity.
    We did some testing and it seems to be caused by the HQ Bloom with Stability Buffer enabled. Note that it seems to be fine in the build, but the editor doesn't like it one bit. Disabling PRISM Effects to get rid of the exception crashed 2 of our computers. :)
    Here's a dump of the exception: https://pastebin.com/LZSeFNZc

    2) Sunshafts produce an artifact when looking directly into the sun. The artifact becomes more and more visible, the more the sun's forward and the look direction align.



    Again, sorry if these have been mentioned previously, but we weren't able to find anything.

    Edit: Image URL

    Cheers,
    Steve
     
  31. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Not at all, thanks for posting! I was actually just working through the second issue with another user and your post helped me put a finger on it and fix it - a new version has been submitted to the Asset Store with the fix (related to noise).

    Regarding the first issue, that is a new one - appreciate the error debug there, now I do know which section of the code it's coming from, but I can't reproduce it on my machine (Blank project > PRISM Demo scene with Bloom Stability on > Switch to different scene, no errors) - is there a chance the next time it occurs you'd be able to double click the error in the console and screenshot exactly which line of code it takes you to? As the line seems to be different on my end.
     
  32. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Hey there!

    That's good to hear, thanks! :)
    You got some Grade-A support going on here, that's as awesome as it is rare.

    For us, the exception occurs in
    PrismEffects
    at line 961:
    if (frame.width != descriptor.width || frame.height != descriptor.height)


    Called by
    CinematicURPPostProcessing_PRISM
    at line 363:
    renderer.Render(cmd, source, destination, ref renderingData, injectionPoint);


    Here's a screenshot for reference of the final call from the stack trace (PrismEffects, line 961):


    Let me know if you need anything else.

    Cheers,
    Steve
     
  33. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    That should be enough for me to have a dig tonight, thanks!

    Also, for everyone else, the new version with the Sunshafts fix is now live on the Asset Store.
     
    pixel_maniacs likes this.
  34. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Thanks for the update!
    Unfortunately I'm getting an error when importing the new version. Even in a new project.

    upload_2021-8-11_9-22-39.png

    When disabling this line of code, everything works as expected and the sunshafts are fixed.
     
  35. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Thanks for the report! That has been fixed & new version uploaded to the asset store.
     
    pixel_maniacs likes this.
  36. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Hey there! Any news on that exception by any chance? :)
     
  37. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    So, we're now using a minor edit to circumvent the exception — not sure if this breaks things in other places, but for now, everything seems to work properly.

    The issue occurs in PRISMEffects in the if-block starting at line 957.

    As far as I can tell, the following line is used to determine if there is already a CameraHistory present.
    gotHistoryValue = _histories.TryGetValue(id, out history)

    If there is a history, i.e. if the _histories dictionary contains a key of the given id, then do stuff. HOWEVER, even if there is a CameraHistory with the given ID, its Frame property may still be null — and this causes trouble.

    Our fix works as following:
    Check beforehand if the TryGetValue function returns true. Also check if history and history.Frame are not null. Only if all those are true, do we continue.

    Code (CSharp):
    1. bool gotHistoryValue = _histories.TryGetValue(id, out history);
    2. bool hasHistory = gotHistoryValue && history != null && history.Frame != null;
    3.  
    4. if (hasHistory == true)
    5. {
    6.    var frame = history.Frame;
    7.    ...
    Now, our stricter if-statement can fail even if there is a history with a given ID. In that case, we try to add a duplicate item to the _histories dictionary, which is illegal. We added a quick check for that, and simply replace the key's value if it already exists.

    Code (CSharp):
    1.    ...
    2. }
    3. else
    4. {
    5.    ...
    6.  
    7.    if (_histories.ContainsKey(id))
    8.    {
    9.       _histories[id] = history;
    10.    }
    11.    else
    12.    {
    13.       _histories.Add(id, history);
    14.    }
    15.    ...
    16. }
    It'd be great to know if any problems come to mind here, as I really didn't dig into anything outside of this single if-clause. Right now, everything looks good, but I'd hate for us to shoot us in the foot with my fix in the long run. :)

    Cheers,
    Steve


    Edit: Clarification
     
    Last edited: Sep 13, 2021
    GoGoGadget likes this.
  38. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Thanks for that, appreciate it! I've added a minor tweak in the second else in the production version but yours should work just fine - it is just that rare error of the history frame being null, which I (still) couldn't coax my Unity into reproducing. Thankfully though, I've tested out the new build on a raw project in 2020.2.3, without issue, and it's now uploading to the Asset Store!
     
    pixel_maniacs likes this.
  39. MasonP5

    MasonP5

    Joined:
    Aug 28, 2021
    Posts:
    2
    I love the asset so far, but one thing I want to suggest is some variables to adjust the ray color of the sun shafts. I will be messing around with the shader file for now to try to get it to where I want it.
     
  40. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Great suggestion! I've emailed you separately with a new version that incorporates sun color (at no additional perf. cost) and will update the Asset Store version of CUPP with this change in the next update.
     
    PutridEx likes this.
  41. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Hey, I'm sure you're super busy with all of the other feature requests, but I was wondering if this is at all possible? And if so, if it would be something you would consider adding?
    Thanks!
     
    GoGoGadget likes this.
  42. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Not at all, thanks for the bump on that one!

    Looks like motion vectors have finally been added in by Unity in the 2021.2 beta - so that means once 2021.2 is out of beta, I'll have a play around and do some investigation into adding it into CUPP. This will of course mean that the feature will only be available for those on 2021.2 and higher.

    It would be super cool to have a proper cinematic motion blur in CUPP, for sure!
     
    JudahMantell likes this.
  43. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    Awesome, looking forward to it! I had no Unity 2021.2 will have motion vectors, good to know.
     
    GoGoGadget likes this.
  44. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    I have two cameras in my scene, both with their own unique Post Processing profile. Both have the PRISM effects property on them, but one has just bloom, and the other has bloom, Lens Distortion, and Color Correction.

    My goal is to have a single UI slider that affects the bloom for both cameras. At the moment it's working as intended, (I'm just setting the value for both profiles in a script) but the camera with lens distortion enabled doesn't use bloom in the same way as the other camera. The overall effect is much less. Even if I disable Color Correction (With the exposure compensation maybe being the issue?), it doesn't fix it.

    Is there something I'm doing incorrectly?
    A bug? Thanks for your help along the way!
     
  45. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    That sounds like the camera with lens distortion enabled isn't receiving an HDR texture. Will need to do some digging but suspect it is on Unity's end, would you mind DMing me a screenshot of the scene with bloom on/off on either camera? Will have a look!
     
    JudahMantell likes this.
  46. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    DM'd! Thanks!
     
  47. two_armed_man

    two_armed_man

    Joined:
    Feb 6, 2020
    Posts:
    11
    Hi, will this work with URP 2D? I'm looking for the blurry chromatic aberration found in the default render pipeline but the URP 2D doesn't have that blur. Looks like yours does.
     
    Last edited: Oct 28, 2021
    GoGoGadget likes this.
  48. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    If only there was a simple answer :D What version of Unity are you on? Unity recently introduced render features to the 2D pipeline, and I haven't tested CUPP on that at this stage.

    Either way, if you buy CUPP and it doesn't work for 2D URP, I'd be happy to either refund or see if it's an easy fix, haven't had too many 2D users enquire but it should work well, definitely one of the (many) render pipelines I'd love to support!
     
  49. two_armed_man

    two_armed_man

    Joined:
    Feb 6, 2020
    Posts:
    11
    Thanks! I'll give it a shot and see how it goes. I'll keep you posted either way and proved the version I'm running it on as well.
     
  50. two_armed_man

    two_armed_man

    Joined:
    Feb 6, 2020
    Posts:
    11

    Looks like this doesn't work with URP 2D renderer. I was in V2021.1.0b12. 2D Forward Renderer has no option to Add "Render Feature".