Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

SC Post Effects Pack [Built-in/URP] - 34 additional effects

Discussion in 'Assets and Asset Store' started by StaggartCreations, Jan 18, 2018.

  1. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    352
    Hallo,

    I used SCPE in our last jam game, and I noticed that the Pixelize effect looks much better if I use floor() instead of round() in the shader (especially with very strong pixelation).

    Also, PostEffectRenderer.cs uses HasFlag(), which produces a tiny bit of garbage and could be replaced with simple bit logic.

    Kind regards,
    ratking
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thanks for sharing! Always a pleasure to see things in action :)

    And thanks for the tip, I'll see if I can incorporate this. Zero GC is definitely a goal.

    The difference between the usage of round/floor will half a "pixel". Currently this is used to make the effect look most stable when it is animated. But I can simply make this an option on the volume component.
     
  3. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    352
    Yeah, I understand, but the visual clarity is lost when round() is used. For comparison:

    Screenshot_3.jpg Screenshot_4.jpg
    Top is floor(), bottom is round().
     
    StaggartCreations likes this.
  4. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Version 2.3.3 is now available!

    Added:
    - Pixelize, option to center pixels and maintain a square aspect ratio

    Fixed:
    - (URP) Effect rendering as gray when editor is paused (applies to effects with the 'Skip Transparents' option enabled and VR usage).
    - Fog, skybox color mode, not working correctly with skybox shaders that use UV coordinates.
    - GetFogDensity sub-graph throwing an error about an uninitialized variable.
     
  5. mr_president

    mr_president

    Joined:
    Jun 28, 2015
    Posts:
    23
    Thanks for the update, and the fix for stylized grass too.

    Found a new issue:
    The ApplyFog shadergraph (at least when used on a lit sprite shader) appears to primarily be affected by the skybox influence slider, and everything else has minimal effect now. Setting skybox influence to 0 for example will make the sprite have no fog applied at all regardless of world position, camera position, and full fog at skybox influence 1 (if density is 1+). Am I supposed to be doing something with the fog density output? I don't remember it being there before. I've done some testing and the emissions output appears to be doing a 0..1 black->white output just from the 0..1 skybox influence alone. Albedo output simply remains unchanged by the shadergraph.

    It was working fine a few versions ago, the sprite even had its fog modified by the rolling height fog changes at the appropriate height, now it's just a solid color on the entire sprite for the most part. If you think this is a problem on my end that I need to fix myself some advice on what changes might've broken it would be helpful.
     
    Last edited: Feb 14, 2023
  6. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    It appears you're right!

    A quick fix for this is to make these changes:
    upload_2023-2-21_15-48-46.png
     
  7. glumleaf

    glumleaf

    Joined:
    Jan 30, 2016
    Posts:
    22
    Thank you so so much for such a thorough reply! Both of your fixes worked perfectly, and your explanation really helped me understand a bit more about skybox shaders. I wish I could leave two 5-star reviews for this asset :)
     
    StaggartCreations likes this.
  8. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    10
    Either I have fundamental misunderstanding of how the depth based edge detection works or there is a small bug in the edge detection effect. With a perspective camera the effect works perfectly: https://imgur.com/ziIlWVk

    But with an orthographic camera the outline only get's drawn around the objects bordering on the void: https://imgur.com/K0kPT88

    The same happens with the edge detection set to cross depth normals. Set to sobel it interestingly looks like this: https://imgur.com/a81PPXY

    Luminance based however works perfectly fine.
     
  9. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I believe in your particular scene most of the edges comes from the "Normals" slider. Since the face directions of the walls are vert different from the upward facing direction of the floor. But the difference in depth is minute, especially in orthographic rendering.

    Though you should expect the same result between a perspective- and orthographic camera:
    upload_2023-2-23_9-55-29.png

    Which render pipeline are you using?
     
  10. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    10
    URP 12.1.10

    Both sliders are set to the maximum but there is no difference for any configuration.
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Parameters should indeed be fine!

    The issue lies with an underlying process not being compatible with orthographic projections. I've made a note to adres this, as I'd like for orthographic cameras to be equally supported.

    For now, you can disable this option on the render feature to use an alternative:
    upload_2023-2-23_13-7-2.png
     
  12. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    10
    Thanks a bunch, that does the trick!
     
  13. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    352
    Hallo, I noticed that the Speedlines effect wouldn't appear for me in the build, only in the editor. I had this problem before, but the reason was something on my side - this time it definitely was something with SCPE, probably since the last update. After a very long debug session, where I would change the order of post-effects, remove some, and do a lot of other things, I finally found the alleged culprit:
    Screenshot_3.jpg
    Only if the toggle is ON for the Noise Tex - no matter if the actual texture is changed or not - then the effect would show, otherwise it never appears. My guess is that Unity somehow thinks that the texture is not used if the toggle is off and doesn't include it in the build. Anyway, this took way too long for me to find out.
     
    Last edited: Feb 25, 2023
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Your findings are entirely correct! This is an issue that's specifically occurs with texture parameters and can be traced back to a change in the volume blending logic that was made a few years ago. Internally, the volume system will blend to a black texture, unless the parameter is overriden. Arguable a bug, but it flies under Unity's radar and made it into URP/HDRP as well (the volume system was porting from the post processing stack's system). It only occurs in a build.

    You'll notice when adding an effect to a profile, any texture parameters are always being overriden by default and will have a default texture assigned. That's solely to ensure the effect will work in a build.
    upload_2023-2-28_11-0-49.png

    I'll make a note to add a warning message below a texture parameter, should it not be overriden. Best to avoid a lot of head scratching :)
     
    ratking likes this.
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Version 2.3.4 is now available!

    Taking a little development break, in order to focus on other and new assets. After which, the Edge Detection is slated to be revised. The intent is to make it possible to combine multiple techniques, as well as adding an animated wiggle to the edges.
     
  16. mr_president

    mr_president

    Joined:
    Jun 28, 2015
    Posts:
    23
    Thanks, is this the same fix that's in the 2.3.4 update? Or were there further changes? (deciding if I should update now or later)
     
  17. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    That's correct, the same changes are included in this update.
     
  18. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    Will there be a fix for the caustics flickering? whenever my camera moves the flickers starts looks terrible. Is the caustic updates in fixed?
     
  19. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @StaggartCreations
    Can I ask a couple of questions about SC Post effects?

    1. Does your asset do a better job with fog and reduced banding? The unity Fog produces terrible banding.
    2. Does SC Post work for Xbox one\series , PS 4\5 and switch?
    Thanks
     
  20. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    There was previously an issue (built-in RP only) where effects like Caustics, Cloud Shadows, Fog and Sketch could twitch/flicker under certain conditions. This was addressed in v2.2.0. Based on the post history in this thread, you were previously using an older version. If that's still the case, I'd recommend updating to also reel in this fix. Perhaps easier to simply remove the asset folder altogether, and import the current asset store version.

    Banding artefacts are typically attributed to the color depth of the rendering output. And is more prominent in non-HDR use cases. So if it occurs, using either fog effect will not make a difference I'm afraid.

    For complete compatibility details, please see this page.
     
  21. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Ok got it.

    Thank you for the info!
     
  22. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    If I remove and read the asset, Do i have to reapply all these effects? or will they sync up? I have the latest version btw and I'm using the built in pipeline
     
  23. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    To my surprise, it seems so. Once the settings classes go missing, they'll be removed from any profile assets in the project. I don't recall this being the case in the past. What worked in my test, was to simply revert the changed profile asset files in source control, restoring them.
     
  24. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223

    But why is this only happening in one specific level? not the other? and what could be causing this?
     
  25. dearsky

    dearsky

    Joined:
    Jan 27, 2019
    Posts:
    10
    upload_2023-4-4_15-30-25.png Hello, this plugin works in Unity Editor, but not works in build. Am I missing some files? My Unity version is 2021.3.18f1. Using builtin pipeline.
     
  26. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Puzzling, never seen such an error before. If I follow the breadcrumbs, the post processing framework is unable to create an instance with the type FogRenderer or CloudShadowsRenderer. Which indicates these classes are somehow not included in a build.

    Any reference I can find to such an error in Unity seems to be related to using Addressables. And mention setting the "Managed stripping level" in Player Settings to 'Low'. That suggest the classes are indeed being unrightfully stripped.

    The underlying issue isn't anything I can address. If possible, excluding profile assets from Addressables should be a viable workaround.
     
  27. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    4,000
  28. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    The Cloud Shadows effect relies on the depth texture, in order to construct a surface to project on. Transparent materials, such as water, aren't rendered into the depth texture, hence it'll appear to pass through it.

    Possible solutions are to incorporate the effect into URP's native shadows or into the water shader itself. Both aren't really straightforward to outline in a few instructions I'm afraid.

    An alternative is using a Light Cookie (unity 2021.2+) on the directional light, and animating the Offset through script.

    upload_2023-4-13_10-14-33.png

    Light cookies are part of URP's lighting model, so will work on any lit surface.

    Though you'd have to add "#pragma multi_compile_fragment _ _LIGHT_COOKIES" to the water shader file, support for light cookies was omitted to reduce the amount of shader variants.
     
  29. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Was "Cloud shadows" already tested on 2022.2.15 + URP?
    We use v2.3.4 and if "Cloud shadows" is turned on the entire screen becomes greyish (no matter what texture/settings we use for cloud shadows), it looks very foggy.
     
  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    It was, yes! In the Frame Debugger you should expect this sort of outcome:
    upload_2023-4-17_12-3-34.png

    If you're seeing a gray screen, that's an indication that an effect is receiving a "null" input from the rendering executed before it.

    Between different Unity versions and configurations I haven't been able to reproduce this in the latest version, despite my best efforts. There was one reported instance, but specific to the 2D Renderer, unfortunately not reproducible either. So there's an explanation for it, but isn't apparent so far.

    If you have any further details to provide about project-specific rendering configurations/setups, that'd be helpful in trying to reproduce the issue.
     
  31. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Frame 91: SRP batch, all looks fine
    https://i.gyazo.com/b86a491ea2fc527166bda4cdd67e22fb.png

    Frame 92: SCPE Cloud Shadows -> Copy Color -> Draw Dynamic: (full gray ..seems to be a unity default texture?)
    https://i.gyazo.com/de0e189490bb9aa96b2a4c098b4fba17.png

    Frame 93: SCPE Cloud Shadows -> Draw Dynamic: (full gray)
    https://i.gyazo.com/761655bb469d6a330191c6d48c6f9052.png

    Camera depth is pure black for RGB, R, G, B..only A is full white.
    Maintext seems to be gray
    Noisetext is from inspector assignment, seems fine.


    Does this give you any pointers maybe?
     
  32. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Certainly, thank you!

    What's puzzling is that the Frame Debugger pretty much looks identical on my end. The only difference being the Copy Color pass not getting any input from the render pipeline.

    In your case, the effect is rendering before transparent materials are. There is no configurable option for that, so just to be sure, that's a modification on your end?
     
  33. dearsky

    dearsky

    Joined:
    Jan 27, 2019
    Posts:
    10
    Thanks. Setting the stripping level to low did solve my problem.
     
  34. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Thanks!
    It was indeed a local modifcation of our team, I assumed I had a clean update but wasn't aware that the "plugins" needed updating manually instead of via the main package.
    All is working as intended now, sorry for the confusion!
     
  35. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Seems like there's an issue with the danger renderer in Unity 2022.3.x, it darkens the entire image. Worked fine in 2022.2.6
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    If I understand correctly, this means if the intensity parameter is 0, the image looks as intended. But no longer when it is >0 (even a bit)?
     
  37. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Yes, that sounds correct.
     
  38. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I can double check. In which render pipeline and color space are you observing this happening?
     
  39. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Happens to me in linear color space, using deferred URP.
     
  40. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thanks for the details.

    I personally can't seen any difference between having the effect on/off (v2.3.4). May be worth checking the Frame Debugger to see if the input effects gets altered (darkened) before the effect renders, as the effect leaves the original screen image untouched (on the input texture's black pixels).
     
  41. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Interesting, looking at frame debugger it seems like enabling Danger Renderer changes some clear calls, in these screenshots I'm only toggling the danger renderer:

     
  42. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    I forgot to mention, and maybe it's important, I'm using light layers, all the objects in the screen along with the lights are not on the default light layer
     
  43. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Curious, the darker image suggests something like color-space conversion happening. However, that's nowhere being done in the shader. You should see this occur with any other effect if that is indeed the case.

    I'm not able to reproduce anything of the sorts, between 2020.3-2023.2. So I'm afraid I can't offer an explanation, as the answer seems to be in debugging in the project's context.

    The rendering path used, or lighting features have no relationship to post processing effects, since they merely alter the screen image as it is presented to them at the point of rendering.
     
  44. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    I managed to make a minimal reproduction case for the issue, in a brand new URP project using the sample project. Simply set the lighting to deferred instead of forward and enable light layers.
     
  45. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Excellent, appreciate it!

    I had a look just now and I can indeed same the same thing happening. The darkening actually comes from the scene being completely shadowed.

    This is probably the strangest issue I've seen yet. According to the Frame Debugger, having an effect enabled causes the 4th render target to go blank (I think that's occlusion data). Under the hood it disables the "Rendering Layers" functionality in URP, which is a very specific thing to do . There's practically no relationship between a post effect (rendering after everything) and something like Deferred rendering or rendering layers, so it's almost comical in nature :confused:

    For now, if you don't need the functionality, you can disable the Rendering Layers feature in your pipeline settings:
    upload_2023-6-28_9-25-56.png

    I'll be able to do some further digging next week. Curious to find out what about exactly in the post-effect render pass affects URP's render loop, must be some explanation. I'd accept a bug in URP, or an oversight on my part.
     
    Dark-1-Games likes this.
  46. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Thanks for confirming!
    I do need rendering layers, I'll just keep the effect off until there's a solution.
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Fortunately managed to track down the culprit, and it actually makes sense to an extent, since the code section involved affects what the render pipeline does at the start of the frame. Why this affects rendering layers, I don't know.

    In the SC Post Effects/Runtime/PostEffectRenderer script file, you can change line 348 from:
    Code (CSharp):
    1.             //Inform the render pipeline which pre-passes are required
    2.             if(requiresDepth) ConfigureInput(ScriptableRenderPassInput.Depth);
    3.             if(!reconstructDepthNormals) ConfigureInput(ScriptableRenderPassInput.Depth | ScriptableRenderPassInput.Normal);
    to:
    Code (CSharp):
    1.             //Inform the render pipeline which pre-passes are required
    2.             ScriptableRenderPassInput requirements = ScriptableRenderPassInput.None;
    3.          
    4.             if(requiresDepth) requirements |= ScriptableRenderPassInput.Depth;
    5.             if(requiresDepthNormals && !reconstructDepthNormals) requirements &= ScriptableRenderPassInput.Normal;
    6.              
    7.             ConfigureInput(requirements);
    I'll be sure to include this change in next update :)
     
    Dark-1-Games likes this.
  48. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    101
    Awesome, thanks for the quick fix!
     
  49. bvonline

    bvonline

    Joined:
    Feb 27, 2021
    Posts:
    85
    Why is the manual content loading not loading (or too slow)?
     
    Last edited: Jul 17, 2023
  50. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    A lot of video content is hosted on Gfycat.com, which was bought up by Snapchat and left to die apparently :p I'm gradually moving stuff over to Imgur