Search Unity

SC Post Effects Pack - 33 additional effects

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

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    I'm unable to reproduce the same effect unfortunately. It may be worthwhile to try to move the Tilt Shift effect to execute before or after other effects. You can do so in the "Custom Effect Sorting" dropdown on the Post Process Layer component on your camera.

    In any event, I'll send you an updated version of the effect, perhaps the issue I described earlier is related.
     
  2. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    33
    Posting here too, there was nothing wrong with Staggarts shader, idiot user error and a combination of blindness and i dont know what.. everything works as intended my bad, sorry!
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,634
    FYI a nice addition would be a distance option to blur. Unity's DOF is rather limited you can't say don't blur objects closer then focal point.
     
  4. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Thanks for the suggestion! This is technically possible, but the result is generally poor looking and should be considered a "budget" DoF effect. Blurring by distance will only increase/decrease the blur amount, where as true Depth of Field effects will increase/decrease the blur radius. The result will resemble a bloom effect.

    Here is a photoshop mockup where you can see what the result would be:
    quantum_theory_distblur.jpg
     
    Lars-Steenhoff likes this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    I love the bloom effect blur
     
    wetcircuit likes this.
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,634
  7. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    33
    Disabling HDR would remove all blur before the focal point if thats is feasible for you. Found this limitation while mixing up DOF with Stags TS.
     
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Submitted version 1.0.2. Note that version 2.1.8+ of the Post Processing Stack is currently not compatible due to a bug introduced in these versions.

    I've meanwhile been working on a script to toggle certain code blocks in shaders. Which I'll be using to configure all the effect shaders for a specific render pipeline during the installation. This'll be needed for the URP in the future as well.
     
    macish and Onevisiongames like this.
  9. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    789
    Hi @StaggartCreations , thanks for this amazing asset!

    Now that directional light support is in, I was wondering if it would be possible to multiply fog by spherical ambient provided by Unity through global shader properties. That is, I believe, could allow the fog to work perfectly with full time of day cycles. I can continuously tweak fog color through scripting, but that would not correctly map it to spherical ambient light and would be just a pale imitation of proper ambient support.

    I apologize if this is already supported in some way and I have missed this in one of the earlier releases - I might be a few versions behind.

    P.S.: I apologize, missed the skybox color mode! It looks almost entirely as expected, except for this strange visual artifact - could you tell me what might be the cause of it? It looks like skybox is sampled without taking camera rotation into account, with the same horizontal angle being used no matter the camera orientation.



    Maybe there is a special camera component I'm supposed to use to update the camera orientation shader property - similarly to how there are special component for fog lights?
     
    Last edited: Nov 27, 2019
  10. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    30
    Those effects are awesome thanks!

    Only one problem, the cloud effect seems to create a weird shadow to the FAE's trees, it create a kind of outline effect.

    Any idea on how to fix this?

    A is a shadow made bu a cube and B is a cloud shadow.
    upload_2019-11-30_12-27-25.png
     
    StaggartCreations likes this.
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Thank you for your purchase! May I ask which anti-aliasing method are you using? And if you're using Deferred or Forward rendering?

    Ps: the cloud shadows effect is going to get distance curve soon. So it can decrease in strength close to the camera. Would work great for casting shadows over distant landscapes only.
     
  12. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Sorry, I seem to have missed your message. The skybox is renderer into fog the with the same transform/FoV as the camera currently rendering fog, this will always be a 1:1 match. Though the default skybox is rather uniform, horizontally, so it may seem like nothing is happening. If this is not the case, please let me know!

    PS to all: I've got the scanlines effect working on HDRP. This took me over an hour, so it may be some time before all the effects are available for HDRP in 2019.3. I'll likely do this in stages
     
    Flurgle, Korindian and Lars-Steenhoff like this.
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    I hope unity will hurry up with custom post effects for URP, and I also hope you don't need to do a full rewrite to get then working once they release the custom post effects for v3
     
    StaggartCreations likes this.
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    From what I was told, it will work very differently from HDRP. Supposedly custom effects for URP (through the volume system at least) is said to arrive somewhere in 2020 release cycle. I'm keeping tabs on GitHub so I can step in early and start figuring it out.

    Though I'm really missing the fog and sun shafts effect in URP at the moment :oops:
     
    Lars-Steenhoff likes this.
  15. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    30
    I'm currently usint TAA but it is not compatible with the cloud effect so to do some test with the cloud effect I switched and tested all the other Anti-Aliasing possibilities and the problem remain.

    EDIT: Oh and after some test I will have to stick with TAA (which I know doesn't work well with both the fog and the cloud shadows). Will that option be available soon?

    Oh and I use deffered rendering.
     
  16. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Thanks for the additional info and testing! I have any idea as to what could be wrong. But'll have to see if I can reproduce this first. I'll be able to get to this next Tuesday.
     
  17. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    30
    No problem, thanks!
     
  18. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    You can also try to disable MSAA in your Quality Settings. This technique poses an issue where the depth texture rendered by Unity is not being anti-aliassed. Which tends to cause depth discrepancies like you're seeing. The depth texture is used by some effects (Fog and Clouds Shadow included), so these are affected.
     
  19. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    789
    I have two cameras in my scene - main game camera rendering everything with the postprocessing layer, and a secondary camera that renders my UI (through NGUI framework). I suspect that what's happening is that the second camera is being used to rotate the skybox in the fog - it seems to be sampled the same what no matter what I do, completely fixed to a horizontal view my UI camera has. UI camera is not using any postprocessing components, though, so I wonder how that came to happen. :)
     
  20. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    249
    Rendering SC fog before transparencies and using the deferred renderer, I was able to use the standard Unity fog on transparent water with reasonable results. In deferred rendering standard Unity fog doesn't work on opaque objects (so there is no conflict with SC fog), but Unity fog does still work on transparent shaders that have Unity fog implemented. This is what we used to do with the Global Fog image effect to handle transparent water. Also the settings of SC fog and Unity fog are separate so you can tweak them independently until you get a decent match.
     
    Last edited: Dec 22, 2019
  21. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    195
    Hi, I'm using 'SCPE 1.0.2' + 'Unity2019.2.0f1'. I turned on the ‘Draw Instanced’ of the terrain and used it with ‘Edge Detection’. As a result, the camera can see the cube behind the mountain.

    20200113102441.jpg
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    I had a look, and according to the frame debugger, instanced terrain is apparently always rendered after Unity is done rendering the Depth Normals texture, which is what the edge detection effect uses. This is not the case for non-instanced terrains. As a result, the edge detection effect doesn't know anything about the terrain and appears to ignore it.

    The only solutions in this case are to switch to the Deferred rendering path (rather than Forward rendering), or to disable instancing for the terrain (not ideal). You can set the rendering path on either the camera, or in Unity's Graphics Settings.
     
    AngelBeatsZzz likes this.
  23. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
  24. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Support for custom effects in URP through the volume system was said to come some time this summer. Though, adopting the post processing framework for HDRP turned out to be more work that I had thought. So unfortuantely compatibility most likely won't follow right after.

    Once I spot it on GitHub, I'll be able to investigate what changes are needed to start porting effects.
     
  25. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    Hi! Thanks! Would be possible to get version with Global Volume, hence effecting the full screen? Thanks
     
  26. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    33
    I've got blowing snow particles that are just using billboards and the material is using the Mobile/Particles/Alpha Blended shader. When I enable fog, the particles only render in the lower part of the screen where the fog is not present (video:
    ). Any idea why this is and how to get around that?
     
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    The fog effect uses the depth texture Unity renders to determine how far away things are from the camera, and thus how much fog they should receive. Transparent materials, such as particles do not contribute to the depth textures, as such they are ignored by fog. This is a very common drawback of screen-space fog.

    A potential improvement is to open the Fog.cs file and replace PostProcessEvent.BeforeStack with PostProcessEvent.BeforeTransparent.This'll have any transparent materials render over the fog. Downside is that transparent materials in the distance will appear to have no fog applied at all. But if your particles are mostly visible in unfogged areas, such as close to the camera, this'll be hardly noticeable
     
  28. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    33
    Thanks for the explanation, that makes sense. Unfortunately, this means that the fog won't render in the sky now due to our use of Enviro. Maybe we can find a way to get a passable snow particle rendering without transparency like the leaf particles in the above video.
     
  29. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    33
    Oh actually, I just realized that not starting the fog density at 0 fixes the issue! I guess I should have tried that to start with...
     
  30. KlutoTek

    KlutoTek

    Joined:
    May 24, 2017
    Posts:
    6
    These effects look fantastic! I am looking for something that can create sun shafts in a 2D setup similar to this. https://rakeshmalikblog.wordpress.com/2016/12/06/unity-scrolling-background/

    I tried the .cs version of the old Unity 5 sun shafts but it didn't work very well. And the old .js version would not be supported with current versions of Unity.

    Is something like this possible with this package?
     
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    I tried it out in the 2D Game Kit project, but it seems the Sunshafts effect is not suitable for 2D. Namely because the position of the sunshaft caster does not translate correctly to a 2D screen position, there's possibly a way around this.

    Secondly, the effect creates a mask from the skybox, so that the sunshafts only cast from the sky, around the sun. 2D games do not have any depth, so this process fails. The solution to this is not very straightforward, as it would require to render a mask from the sprites that make specifically make up the background
     
  32. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,242
    I know its not supported on mobile, but it works great on iOS

    Im wondering if there's just like s setting or line of code that keeps t from running on android.

    On android there is just an error when I try to add it to the PP stack

    I attached a screenshot. Is there anything off the top of your head that you think is blocking this?

    Do I have to implicitly "install" SCPE in the project?

    Screen Shot 2020-04-01 at 4.22.52 PM.png
     
  33. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,242
    I added ;SCPE to the Scripting Defines Symbols text box in the Build Settings for android. I haven't tested it on android device yet, but doing this did get rid of the script errors.
     
    camta005 likes this.
  34. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,242
    OK the SCPE effects work in editor in Android great. The only thing I can figure out is how to reference it to turn it on and off and adjust the values.

    On iOS I use :

    private SCPE.Pixelize pixelize = null;

    void Start()
    {
    volume.profile.TryGetSettings(out pixelize);
    }​

    And I think this is what sets a reference to the effect in the PPstack. Then I enable it

    pixelize.enabled.value = true;​

    But when I try it on Android I get a null reference exception. The code is valid, but on start it doesn't assign an instance of SCPE.Pixelize to the pixelize variable.

    Do you have any suggestions?

    UPDATE: Ok I had a reference to the PP volume

    public PostProcessVolume volume;

    And in my component there was. preference there but it wasn't finding it in the script. I just re-dragged the volume component to my volume variable and it all works. Ill try it on an actual device too. Thank for the sounding board, it helps me organize my thoughts to say them to loud.
     
    Last edited: Apr 2, 2020
    StaggartCreations likes this.
  35. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    946
    Update on URP/HDRP compatibility in Unity 2019.3+. This has been on my radar for a while and I'm working on making sure this package will still be usable for the years to come. Effects will make use of the SRP volume system, just like built-in Unity effects.

    In order preserve backwards compatibility, and to avoid having a mess of separate scripts/shaders per render pipeline, I had to lay a lot groundwork to get this done. Essentially reworking the entire asset. No point in delving into the technical aspects involved, but the installer now only requires to change one file to switch render pipelines.

    So far this has been a slow and often frustrating process, since every change requires to be backported to 2 other render pipelines (and often breaks something else). Fortunately I've reached baseline and successfully ported the Blur and Sunshafts effect to this new system.

    Version 1.1.0 will include all these changes. Basically nothing will appear to have changed, but with this out of the way I can port over effects to support URP/HDRP a few at a time. Admittedly, this is rather tedious work to do, and takes up a few hours to a day per effect, so will roll out gradually.

    Thanks for the patience so far, as much as I'd like to have everything done by tomorrow, there's still a lot of work involved ;)

    Trello board remains available here: https://trello.com/b/J5mEv8Cn/sc-post-effects
     
    Last edited: Apr 3, 2020
  36. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,242
    I can only imagine how tricky it is to support 3 render pipelines. Congrats on making such progress and for all your hard work. I hope this is very successful.
     
    StaggartCreations and hopeful like this.
unityunity