Search Unity

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

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

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Adding a simple reusable URP render feature, for next update, that takes a custom material:
    upload_2021-2-12_16-48-4.png

    This makes creating custom effects using Shader Graph super straightforward. I've added a sub-graph to grab the current screen contents, which can be modified before sending the result to the output color (post-processing in a nutshell)

    Here's an example of a simple fog effect, using a few of the sub-graphs I made:
    upload_2021-2-12_16-45-32.png
     
    GliderGuy, hopeful and Lars-Steenhoff like this.
  2. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    148
    I just upgraded to the latest unity and got this list of errors. no idea how to fix it. please advise.



    Capture.PNG
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    If it occurs the first time you open the project after upgrading, it's nothing to worry about and won't show up again ;)
     
  4. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    148
    Its definitely worrying due to the fact that I cannot run my game unless this is cleared. Any ideas? Its basically giving me 463 different error. Man this is why i hate upgrading. I make backups, but still. I'll keep digging

     
  5. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    148
    Ok never mind, i restarted unity and now it works. lol

     
  6. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    148
    UPDATE/EDIT:
    nevermind i found it in your code and just changed the range! They called me a madman....


    upload_2021-3-12_8-58-36.png




    Original Message:

    Hey staggart, so is there ANY way I can make the Caustics BIGGER? The minimum number I can use to change the Caustic "size" is 0.01. I looked in the code to see if there is a way to change that range to lower numbers like 0.001.
    I am trying to make my caustic ripple larger in size by reducing the size number. the caustics are too "small" and doesn't match my water. I can try using a different texture or generate one but changing the size should be easier to do. see below.

    upload_2021-3-12_8-49-13.png
     
    Last edited: Mar 12, 2021
  7. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    55
    After the latest upgrade cloud shadows stopped working for me. No changes made to any PP setting. Just updated to the latest version. Am i missing something? 2019.4.21 Buildin

    Well a clean project works. Gna.. now some playing in the hay is in order.

    Edit: so it was the new fade settings. They practically removed the shadows in my top down view and where only visible very faar away at full density. Setting End Fade Distance to 0 made them look the same density as before.

    Was it the way before that the camera angle was heavily influencing the cloud shadows? I don't recall this be the case.
     
    Last edited: Mar 14, 2021
    hopeful likes this.
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    That's correct, the distance fading was added in last update. Because these settings are new, they get the default values on already existing profiles unfortunately.

    The angle shouldn't matter, but orthographic cameras aren't supported by the effect, are you using one?
     
    macish likes this.
  9. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,078
    @StaggartCreations Do you have plans to add projection angle to the clouds and caustics?
    It would help my city with buildings scene a lot, thanks
     
  10. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Yes, already have this as a working option for the built-in RP, but URP is still throwing a tantrum.

    Side note, the light direction realistically can't be animated using this approach, since it causes the projected texture to rapidly move around. An unwelcome limitation of doing it in screen-space.
     
    Lars-Steenhoff likes this.
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Submitted v2.1.7. Update guide

    Added:
    - Custom Effect render feature, this allows custom effects to be created using Shader Graph.
    • The Runtime/Custom folder contains an example graph, and several common-use sub-graphs
    - Option to project from the brightest directional light for Caustics and Clouds Shadows
    - Luminance threshold parameter to Overlay effect, so it can double as a lens dirt effect
     
    Lars-Steenhoff likes this.
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,078
    Nice to see you got it to work! Thanks for the updates
     
    StaggartCreations likes this.
  13. iansnyder

    iansnyder

    Joined:
    Dec 22, 2012
    Posts:
    23
    Hey there! I've been using SC Post Effects and loving them, and I'm now trying to add simple split-screen multiplayer to my game and I'm running into issues. I am using multiple cameras, rendering to a Render Texture to give a low-rez look, but the post-effects break the multiple cameras on the Render Texture. I found this article from catlikecoding: https://catlikecoding.com/unity/tutorials/custom-srp/multiple-cameras/

    The issue seems to be in the first part where he says: "This happens because an invocation of SetRenderTarget also resets the viewport to cover the entire target. To apply the viewport to the final post FX pass we have to set the viewport after setting the target and before drawing. "

    Is there some simple way for me to make this work with SC Post Effects? Thanks for any help you can provide!

    EDIT: I'm using the Built-in Renderer (old renderer) and Unity 2019.4
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    The information you linked may not exactly apply to Unity's post processing package, since its for the built-in RP, but I can't be sure.

    I've set up a test scene with a split screen layout but I'm not seeing any difference with post processing enabled. Could you elaborate what's not working specifically?
    upload_2021-3-24_9-9-47.png
     

    Attached Files:

  15. iansnyder

    iansnyder

    Joined:
    Dec 22, 2012
    Posts:
    23
    Sorry I should've just included pictures! Also it's totally possible that I have a stupid setup so let me know :D
    • I have 2 players, each with their own camera that has a Target Texture they render to
    • Each camera also has a Post-process Layer Component
    • I then have a third camera that is just looking at a quad that has an Unlit texture with the Render Texture set as the texture to use -- this is how I'm down-rezzing the final result (maybe this is the problem?)
      • This third camera has its culling mask set to only render the quad in front of it
    When I disable the Post-process Layer components on the cameras I get this:
    upload_2021-3-24_8-5-45.png

    But when they're enabled it's this:
    upload_2021-3-24_8-6-32.png

    So it's like I'm just getting the player 1 screen stretched out -- I tried playing around with things but couldn't figure out what's going on. I really appreciate the help!
     
  16. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    I suspect the third camera has something to do with it, seeing as without this set up in my end I can't reproduce anything of the sorts. Enabling the "Directly to Camera Target" checkbox on the post processing layer may have a positive effect.

    An alternative would be to take the two RT's from each camera and composite them in a shader to be placed side by side. It would be a matter of scaling/offsetting the UV's for both, coincidentally the camera's viewport rect represents these values already.

    What you're doing with the unlit quad is effectively how a post processing effect works, but the same can be achieved with Graphics.Blit(RenderTexture source, RenderTexture destination, Material material). Internally this also draws a quad to the screen, but doesn't require it a separate camera with a layer mask. The oldschool OnRenderImage post processing technique may still work for this, the output of the Blit will be draw to the camera's final color image and be displayed on screen.

    But to the same effect you can use the Pixelize effect, it won't actually downscale the resolution, but visually looks the same. This wouldn't require a third camera, or render textures.
     
  17. iansnyder

    iansnyder

    Joined:
    Dec 22, 2012
    Posts:
    23
    Welllp I'm gonna say maybe I did this implementation before getting SC Post Effects? XD I just switched to do that and everything works great. You are awesome!!
     
    StaggartCreations likes this.
  18. iansnyder

    iansnyder

    Joined:
    Dec 22, 2012
    Posts:
    23
    Ok actually one more question :p I am using Double Vision and Speed Lines for individual players -- what's the best way to set that up? Should I just use a non-global Post Process Volume attached to each player's camera with a tiny Blend Distance, or is there a better way? Thanks a million!
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    The layer you configure on the PostProcessLayer component attached to a camera doesn't actually have anything to do with rendering. But it represents the layer of settings (as represented by volumes) for that specific camera. So you can have volumes on the detault "PostProcessing" layer, and add all base effects to it. Then create two layers for the individual cameras, and add two new volume assigned to one of the layers. This way you have use volume settings, that only apply to a specific camera.

    The PostProcessLayer allows setting multiple layers, so you can mix the "base" volumes with those on a specific layer.
     
    iansnyder likes this.
  20. iansnyder

    iansnyder

    Joined:
    Dec 22, 2012
    Posts:
    23
    Thanks so much, that's perfect for this! :cool:
    EDIT: Works great!!
     
    Last edited: Mar 27, 2021
  21. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    25
    Hi, I'm using Unity 2020.3, Post Processing stack isn't supported, only the integrated version.

    I was wondering if your latest version works with it before purchase. Specifically, a 2D project, using URP lights and your sun shafts. Is there a lite version, or a demo version? Thanks.
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    URP's integrated system is supported, specifically the volume system. Though the 2D renderer doesn't allow the use of render features, so there's no entry point to do post processing effects unfortunately. It was said this would be added in the future, but these promises tend to drag out 1-2 years :p
     
    hopeful likes this.
  23. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    25
    Oh, what a pity, and downgrading is incredibly difficult. At least the default post processing contains some useful ones, but is missing a lot. Thanks a lot for your reply.
     
  24. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    5
    Hi, I'm using Unity 2019.4.20f1 URP and I'm trying to use the Tilt Shift effect. It works in the Editor but I can't get it to work at runtime. I am assuming I am being stupid somehow and forgot to do something on the camera but all the other effects work so I am really not sure. Any idea? Thanks! Editor View.PNG Play Orthographic.PNG Play Perspective.PNG
     
  25. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Hi, do you mean the effect fails to work in a build?

    If so, you can try to add the Tilft Shift shader to the "Always include" list under Graphics Settings. The shader is in any case included in a build, but there have been some spotty instances where this somehow wasn't the case. In the player log there would an error with the tag "[SC Post Effects]".

    Another explanation could be that the "Depth texture" option is disabled in the pipeline settings, possibly one that's used by a specific quality level.
     
  26. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    5
    I haven't tried a build yet but it doesn't work in play mode. The depth texture was indeed disabled but it didn't make a difference. I also put the shader in the "always include" but to no avail.
     
  27. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    5
    If it's any help here are my camera and pipeline settings
     

    Attached Files:

  28. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Thanks for the screenshots! Nothing strikes me as incorrect, especially if post-processing already works for you.

    Peculiar issue though, you can check if the Tilt Shift effect is in fact doing anything for the Game view by enabling the "Visualize area" button (may have to click in the Game view once to refresh it).

    upload_2021-4-20_16-17-7.png

    If you don't see the black/white preview. It may be worthwhile to try and move the Tilft Shift effect to the bottom of the list on the camera's PostProcessLayer component.
     
  29. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    5
    Hmm I am assuming this visualized area should be in order. I put the Tilt Shift effect at the bottom of the list just to see if it makes a difference but it changed nothing.
     

    Attached Files:

  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Thanks for checking, if you're seeing that, it means the effect is properly being applied. I've double checked in a URP project with the Post Processing package combination, but the scene- and game view end up looking identical for me. So I'm afraid I can't really explain your situation. You can try to bring down the "Size" parameter to 0, which should be blurring the entire screen.
     
  31. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    5
    Hmm ok, thanks for trying. I'll keep experimenting a bit and see if I can't get it to work after all. I'll write again if I find something that works.
     
  32. NinjaMonkeyTom

    NinjaMonkeyTom

    Joined:
    Apr 28, 2015
    Posts:
    6
    Hey just want to start by saying I love the effects! They're really useful for achieving the look I'm aiming for with my work.

    I've run into a problem with the fog post effect. Is there any way to get it to work with unlit URP shaders? I've attached an example to demonstrate the issue. The white cube is unlit but the fog draws over it. I assume this is something to do with the way unlit shaders handle depth. The unlit cube seems to use the depth of whatever is behind it and it gets the same amount of fog as it.

    Thanks
     

    Attached Files:

  33. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    You're on the right track! If a material is transparent, it will not contribute to the depth texture the fog effect relies on, so it will appear to ignore it. Like you said, it will receive an amount of fog based on whatever is behind it (extremely noticable if that's the skybox).

    The only way around is is to incorporate the fog shading into the shader itself, much like how the built-in Unity fog works. Unfortunately there's no way to simply replace Unity's fog rendering, without modifying the URP shader libraries directly. It would be sweet, because the fog wouldn't have to be done through a post processing effect.

    So you would need to create a Shader Graph for any transparent materials you want to use in combination with the fog.

    In the Runtime/Fog/ShaderGraph folder there is a Sub Graph that can take care of this, there's an example graph (Transparent_wFogSupport) that shows how it should be incorporated into a lit or unlit graph:
    upload_2021-4-22_10-46-22.png

    For this to work, you'll have to enable the "Skip Transparents" option on the render feature. This way the fog doesn't apply to transparent objects at all, and allows them to handle the fog shading on their own.
    upload_2021-4-22_10-48-0.png
     
    NinjaMonkeyTom likes this.
  34. NinjaMonkeyTom

    NinjaMonkeyTom

    Joined:
    Apr 28, 2015
    Posts:
    6
    Thanks so much! I'll give that a go.
     
  35. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    would support for unity gradients instead of a texture be possible for the gradient fog effect in the future? it would be super nice to be able to adjust the gradients while seeing them update live in the scene...
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Agreed! However the Post-processing stack and Volume system does not have a blend-able gradient data type. I remember fiddling with exposing a regular gradient, then baking it to a texture. But there were some caveats like not having a proper way to save the texture or determine when it should be re-baked. Warrants another attempt, the main danger to avoid is that it ends up being slow in the effect's editor.
     
  37. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    377
    I have a request...

    I plan to try myself but I might as well ask.

    I think it would be cool if you could make a better DoF effect that increase exposure based on the strength of the effect.

    This is something I saw in Judgement and Yakuza:Like a Dragon.



    It would help with more bokeh like effects too, cause otherwise you have to try really hard to get brighter distinct shapes.
     
  38. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    87
    Just wonder, why all Staggart Creations assets scan all projects files while importing to the project?
    It takes a lot of time to do so (almost 20 minutes on my recent project) and takes away all fun with the Unity.
    Is it really necessary?
     
  39. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Hmm no, what are you basing this off?

    A lot of people install an asset into a project that's missing a package dependency, using an incompatible render pipeline, or Unity version. Then assume the asset is broken and take it out in the review section or writing frustrated emails, despite the store page and documentation being very clear about any restrictions or requirements. The last 3 assets I released all had 1 star reviews on the first day because people did not read the bolded text :p So it's proven a certain degree of handholding and safeguarding is needed.

    When an asset is first imported, or updated, I'll have to perform a check for any dependencies and the Unity version. In case something is not right, I can display a warning. 20 minutes can't be right though, since the code will only go over the files imported from the asset itself.
     
  40. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    377
    You might have unity recompiling shaders all the time. There's a setting for this...

    I think "Project Settings/Editor/Asychronus Shader Compilation", I had to turn this off for Amplify shader.

    That may help with this, or it might be something else hard to say.
     
  41. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    28
    This looks ace and I'm particularly interested in skybox color fog so I gave it a go but I'm having a number of weird problems on URP Unity 2021.1.6f1, which I know is not fully supported as yet but I figure may need feedback.

    When I add the asset to the project, the fog volume override does show in the editor camera but not the in-game one. Post-processing is enabled on the camera.

    But that's not really the biggest problem, the main one is that memory usage flies off the charts making unity crash within a couple of minutes! I've confirmed this only happens with the SC Post Effects package in the assets directory. Anything I can do to help debug that?

    Finally, the project I'm working on operates over very large areas and I need to use a floating origin to reset the player to 0,0,0 quite frequently, offsetting the world by the inverse. I presume for these post processes to work correctly in that environment the volume would need to apply to the player?
     
  42. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Thanks for the feedback! 2021.1 is a release version, so is supported (forgot to update the documentation there!)

    While profiling I'm not seeing a memory leak, but looking at the code now I have an idea why this may be. I'll send you a modified file later today.

    What I see is that if the main camera doesn't have the default "Main Camera" tag the volume settings won't apply correctly scene-view camera, since this always copies a number of parameters from the main camera, for things to look the same. Without the tag, fog is actually still rendering in the scene view, but the color of all the objects is captured, rather just the skybox. This is an idiosyncrasie I've encountered before, where this behavior somehow differs between the scene- and game view camera. I assume this because the skybox can be toggled in the scene view, so it's rendered differently under the hood.

    You can use origin-shifting with volumes, but this only applies to local volumes that have a box/sphere trigger.
     
    Last edited: May 19, 2021
  43. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    28
    I looks like my player camera does have that default tag but I'm happy to test a modified file

    Getting off-topic now but any idea how I would make that work with an infinite world if the box trigger is finite? Would shifting the origin or the trigger (rather than the object transform) apply effects without resetting position?
     
  44. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    I believe so yes, under the hood Unity's physics engine is used to determine a the camera is inside a volume or not, so moving the collider's center should have the same effect.

    Meanwhile tracked down an issue, which weird also relates to the camera tag. I have good faith this will avoid any memory leaks as well.
     
    jukibom likes this.
  45. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    28
    Awesome, thanks! I'll let you know how I get on :D
     
  46. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    is it possible to use camera stacking with the fog? I am trying to create a skybox with mesh items that are not affected by the PP fog or even have their own fog settings. I tried this and the set the "only overlay" setting on the render feature but the depth is drawn wrong and base items overlap overlay items.
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,655
    Unfortunately, not entirely. With the way camera stacking works in URP, depth-based effects aren't able to render as expected. The "Clear depth" option has to be disabled on the overlay camera, but this had the disadvantage of the geometry it renders clipping through the geometry the base camera renders. Ideally, the camera stacking system would combine the depth textures of all cameras, and pass that on. I tried to work around this, but it was really swimming against the stream.

    It's a mix between technical and design oversights, likely because Unity doesn't have any sort of depth-based post processing effects, so isn't part of their testing. Hopefully they'll hit that roadblock soon so it becomes workable.

    If you want everything on the overlay camera to not be affected by fog, that's inadvertently possible by enabling the "Clear depth" option on the overlay camera and setting the "Allowed camera types" dropdown on the fog render feature to "Base".

    EDIT: You can use a different renderers, per camera, and only have the fog render feature on one of them
     
    Last edited: May 19, 2021
    jukibom likes this.
  48. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
  49. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    interesting. So i just tried creating an extra forward renderer as you suggested. But the fog would continue to render the base layers over the top layers. Only when I added the fog feature to the second renderer and turned the fog density down to 0 did it work.
     
  50. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    i see what you mean with this depth problem. i sure wish unity would have considered depth.
     
unityunity