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. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Submitted version 2.3.5! Note that this is the last version to support Unity 2020.

    Some notable changes were made to the Fog effect. The vertical height can now be limited, allowing the skybox to come through above the horizon. Additionally, the directional light scattering effect can be scaled in size.
    upload_2023-8-5_12-15-55.png

    All the Refraction sample textures were reauthored for improved quality and resolution:
    upload_2023-8-5_12-18-45.png

    The effect now has a color tint parameter, making things like water drops more visible:
    upload_2023-8-5_12-25-55.png

    Changelog:

    Added:
    - Color Split, "Luminance threshold" parameter, making it possible to limit the effect to emissive surfaces.
    - Transition, color parameter (default was black) and invert option.
    - Refraction, color tint parameter.
    - Fog, directional light exponent parameter
    - Fog, now supports height fading into the skybox

    Changed:
    - Refraction, re-authored all sample textures for improved quality.
    - Reduced number of texture samplers in Fog shader library, to avoid reaching the maximum of 16 samplers when incorporated into a surface shader.
    - Color Split, "Edge Masking" parameter now scales down the offset, rather than decreasing the opacity.
    - (URP) Fog shading function (for transparent materials) is now tied to a boolean. If the volume component isn't present the fog shading will be skipped.
    - (URP) Edge Detection now uses the GBuffer information when deferred rendering is used

    Fixed:
    - (URP) Shader errors in Unity 2023.2+ due to now clashing parameter names
    - (URP) Effects causing scene to be flooded with shadows when using Deferred rendering in Unity 2022.2+
     
    adamgolden and hopeful like this.
  2. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    937
    I'm having an issue where fog seems to be incompatible with kuwahara? Having both on makes the whole screen white.

    Using Unity 2022.3.9 in DX12 mode.
     
    Last edited: Sep 15, 2023
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Curious, white is a very specific color to be shown. There is no real relationship between the two effects, other than them both being separate, I'd expect the same bug to appear when swapping out Kuwahara with something else.

    I'm not able to reproduce anything of the sorts in the same version/graphics API. So pinpointing the cause would require some debugging in your project.
    upload_2023-9-15_9-52-9.png
     
  4. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    937
    upload_2023-9-15_4-55-47.png

    I think i figured out what's happening? Seems like it's related to the "Skip Transparents" setting? This causes the whole scene to render gray and depending on the scene causes kuwahara to do weird things if set before unity post processing.

    I also see that part of the issue is Stylizes Water 2 Underwater? That specifically causes the whole screen to explode into white particularly if underwater even partially.

    Both go away if skip transparent is disabled.
     
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Ah yes, gray makes more sense, that's the color of a default/uninitialized texture in Unity.

    This is actually a known issue, that's been reported twice so far, and is indeed specific to rendering an effect before transparent geometry. Since in this case it's required to make a copy of the screen contents and apply the effect to that.

    Problem seems to be that this process receives an empty input. This input would be empty:
    upload_2023-9-15_13-45-55.png

    But not always? I don't know if my implementation is wrong (for a good part it is hacked/self-fabricated out of necessity) or its a URP bug (it occured since 2022.2). So far I've been left and right trying to reproduce it, across different setups and projects, but without any success. Which unfortunately means I can't determine a fix either.
     
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    937
    Maybe it relates to the water asset since that supports the fog?
     
  7. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    Hi there, i decide to use this asset on an empty project, so far some of the effect works fine for me but the speedline throw me some error and unity got stuck, am i the only with this issue?

    here the error log

    AssertionException: Assertion failure. Values are not equal.
    Expected: 512 == 1024
    UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <d0f92ebb771e4783b0ea9f13bfbe129b>:0)
    UnityEngine.Assertions.Assert.AreEqual[T] (T expected, T actual, System.String message, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <d0f92ebb771e4783b0ea9f13bfbe129b>:0)
    UnityEngine.Assertions.Assert.AreEqual[T] (T expected, T actual, System.String message) (at <d0f92ebb771e4783b0ea9f13bfbe129b>:0)
    UnityEngine.Assertions.Assert.AreEqual (System.Int32 expected, System.Int32 actual) (at <d0f92ebb771e4783b0ea9f13bfbe129b>:0)
    UnityEngine.Rendering.PostProcessing.TextureLerper.Lerp (UnityEngine.Texture from, UnityEngine.Texture to, System.Single t) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/Utils/TextureLerper.cs:103)
    UnityEngine.Rendering.PostProcessing.TextureParameter.Interp (UnityEngine.Texture from, UnityEngine.Texture to, System.Single t) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/ParameterOverride.cs:568)
    UnityEngine.Rendering.PostProcessing.ParameterOverride`1[T].Interp (UnityEngine.Rendering.PostProcessing.ParameterOverride from, UnityEngine.Rendering.PostProcessing.ParameterOverride to, System.Single t) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/ParameterOverride.cs:121)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.OverrideSettings (System.Collections.Generic.List`1[T] baseSettings, System.Single interpFactor) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/PostProcessLayer.cs:801)
    UnityEngine.Rendering.PostProcessing.PostProcessManager.UpdateSettings (UnityEngine.Rendering.PostProcessing.PostProcessLayer postProcessLayer, UnityEngine.Camera camera) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/PostProcessManager.cs:394)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.UpdateVolumeSystem (UnityEngine.Camera cam, UnityEngine.Rendering.CommandBuffer cmd) (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/PostProcessLayer.cs:933)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/PostProcessLayer.cs:562)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at ./Library/PackageCache/com.unity.postprocessing@3.3.0/PostProcessing/Runtime/PostProcessLayer.cs:487)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    This particular error is due to a long standing bug in Unity's volume blending framework I'm afraid. It occurs when a texture parameter is overridden on an effect, but no texture is assigned. You'll see an error message in the UI to warn against this.

    It can be avoided by assigning a texture, rather than leaving the field empty.
     
  9. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,279
    Greetings! I've updated to the latest version (and also to unity 2022) and have run into a few issues.

    The first is what was already mentioned - fog making everything grey when transparents are enabled. I just disabled it affecting transparents for now, so that's fine!

    The first is that the blur effect seems to become grey.

    I tried disabling all other effects, fiddled with all the universal settings / blur effect settings, but I haven't been able to find a way to fix this.

    The second is that now the directional light effect seems to become black when the light is dark. This is quite different to how it used to be. How can I make it work like it did previously (ie always additive, and a black light adds 0, not subtracting)


    Thanks a bunch!
     
  10. SOL3BREAKER

    SOL3BREAKER

    Joined:
    Oct 11, 2021
    Posts:
    44
    I got around 1.3kb gc per frame when using sun shaft, where does it come from?
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thanks for the details. If you are able to share a repo-project, that'd be most helpful. I am unable to reproduce this gray screen issue in any context I've tried it in.

    Unity's volume blending system has some GC overhead in every render pipeline (192kb) out of the box. It'll only shown using deep profiling.

    There may be other causes for unintentional GC. But bear with me, the first priority is survive the obstacle course that Unity laid out by changing the rendering API every version. The same code needs to work from Unity 2019 through 2023, which may give room to unwanted overhead.
     
    joshcamas likes this.
  12. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    937
    The gray might be related to DX12, I believe i also experienced this but forgot to post.
     
    StaggartCreations likes this.
  13. Garien

    Garien

    Joined:
    Oct 11, 2018
    Posts:
    36
    Hey @StaggartCreations , super clean asset! Been using it on a project, it worked well for the most part. However, stumbled upon some issues:

    When I tested with a 3D URP renderer, most effects worked fine, except for blur, which resulted in a black screen.

    I then changed to a new scene with new post process volumes, as well as changing the scriptable render pipeline settings (under project settings -> graphics) to a 2D URP renderer - my project will transition from 3D to 2D on some scenes.

    After switching, I could not make the post process effects from the package work with the 2D URP renderer. Whenever I try to add any effect (in this case, scanlines), a black screen appeared and the following error pops up on console:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Rendering.CoreUtils.FixupDepthSlice (System.Int32 depthSlice, UnityEngine.Rendering.RTHandle buffer) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.8/Runtime/Utilities/CoreUtils.cs:249)
    UnityEngine.Rendering.CoreUtils.SetRenderTarget (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle buffer, UnityEngine.Rendering.ClearFlag clearFlag, UnityEngine.Color clearColor, System.Int32 miplevel, UnityEngine.CubemapFace cubemapFace, System.Int32 depthSlice) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.8/Runtime/Utilities/CoreUtils.cs:583)
    UnityEngine.Rendering.CoreUtils.SetRenderTarget (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle buffer, UnityEngine.Rendering.ClearFlag clearFlag, System.Int32 miplevel, UnityEngine.CubemapFace cubemapFace, System.Int32 depthSlice) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.8/Runtime/Utilities/CoreUtils.cs:598)
    UnityEngine.Rendering.Blitter.BlitCameraTexture (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle source, UnityEngine.Rendering.RTHandle destination, UnityEngine.Material material, System.Int32 pass) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.8/Runtime/Utilities/Blitter.cs:376)
    UnityEngine.Rendering.Universal.ScriptableRenderPass.Blit (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle source, UnityEngine.Rendering.RTHandle destination, UnityEngine.Material material, System.Int32 passIndex) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/Passes/ScriptableRenderPass.cs:718)
    UnityEngine.Rendering.Universal.ScriptableRenderPass.Blit (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.Universal.RenderingData& data, UnityEngine.Material material, System.Int32 passIndex) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/Passes/ScriptableRenderPass.cs:732)
    SCPE.PostEffectRenderer`1[T].FinalBlit (UnityEngine.Rendering.Universal.ScriptableRenderPass pass, UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.Universal.RenderingData renderingData, System.Int32 passIndex) (at Assets/SC Post Effects/Runtime/PostEffectRenderer.cs:541)
    SCPE.ScanlinesRenderer+ScanlinesRenderPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Assets/SC Post Effects/Runtime/Scanlines/ScanlinesRenderer.cs:45)
    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@14.0.8/Runtime/ScriptableRenderer.cs:1490)
    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@14.0.8/Runtime/ScriptableRenderer.cs:1446)
    UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/ScriptableRenderer.cs:1229)
    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@14.0.8/Runtime/UniversalRenderPipeline.cs:658)
    UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/UniversalRenderPipeline.cs:824)
    UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/UniversalRenderPipeline.cs:369)
    UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <3b24cc7fa9794ed8ab04312c53e6dedd>:0)
    UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <3b24cc7fa9794ed8ab04312c53e6dedd>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    After this error, if I close and reopen the project, and go back in the 2D scene, and try to add the same effect (scanlines), a grey screen appears and the console is clear. If I switch the render pipeline to 3D and go back to the 3D scene, the scanline (and any other newly added effect) now results in a grey screen.


    I thought at first that this might be related to me switching render pipelines, but then I created a new project from scratch, using 2D URP and imported the package, trying to narrow down the issue. The grey screen happened on the clean project as well, I could not get any effect to work on 2D URP.


    Since this might be too much, I recorded a video of me replicating all issues mentioned with some text explaining it, repro rate is 100%. Hope the video is helpful to troubleshoot it :)

    Video detailing issues:



    On the print, the SC Post Process effect window on both projects:
    upload_2023-10-20_2-21-2.png


    Summing up, issues are:
    #1. Blur results in a black screen on 3D URP
    #2. Getting grey screen when trying to apply effects on 2D URP (even on a fresh project)
    #3. Changing the pipeline from 2D to 3D and trying to apply a new effect results in a black screen + console error.

    All using Unity 2022.3.10f1

    Any help would be much appreciated. Thank you !
     
    Last edited: Oct 21, 2023
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I never expected anyone to switch between a 2D and 3D renderer from frame to frame :p That is in fact not supported. There's a check for which type of renderer is being used once per domain reload, because it involves reflection to access internal information about the renderer, prohibitively expensive to do every frame.

    I can easily reproduce the same error when switching to a 2D renderer. When 2D is used, the post processing rendering pass needs to take this into account. If you were to close and reopen the project, everything would appear to be in order.

    I've had a look at the code, and managed to take a changing renderer into account efficiently. So moving forward that will be supported. I can verify the error is no longer present after these changes.

    About the gray screen, it's maddening but I'm not seeing this occur anywhere. Even in a brand new project using the 2D renderer template.

    Makes me wonder if its somehow related to something more technical like GPU vendors or drivers. Surely it can't be because I always install the asset as a package?

    As a sanity check, I imported the asset from the asset store. Besides some harmless meta file differences I spot this difference:
    upload_2023-10-24_11-8-23.png

    And that is EXACTLY why effects are receiving a blank input texture (gray) :rolleyes:

    I don't know how that particular change ended up in the published version, it appears to be a version of the file from v2.3.0 (12 months ago).

    By all means an embarrassing oversight :p I'll be able to submit an update shortly to correct this.
     
    Garien likes this.
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Submitted version 2.3.6

    This is the last version supporting Unity 2020.3

    Added:
    - (URP) Support for switching between a 3D and 2D renderer, or switching rendering paths.

    Fixed:
    - Effects appearing as a gray screen in Unity 2022.2+ when using the 2D renderer or having the "Skip Transparents" option enabled on a render feature.
    - Sketch, canceling out Bloom or other HDR-based effects.
    - Fog, if Directional Light shading was disabled, a darker tint was present where the sun would be in the sky.
     
    Last edited: Oct 24, 2023
    Garien likes this.
  16. Garien

    Garien

    Joined:
    Oct 11, 2018
    Posts:
    36
    Mad respect, your professionalism is something else. I've been keeping an eye on your other assets as well, and will definitely buy them in the future.

    On a side note: I won't change from 2D to 3D frame by frame, but per scene basis. Some scenes will be 2D and other 3D, but when the scene is loaded, the pipeline will be changed through code :)

    I was about to offer uploading the 2D project with the issue somewhere so you could repro the grey screen issue, but seems I won't need to - I'm glad you managed to find the issue ! Thanks a lot!
     
    StaggartCreations likes this.
  17. DrewofDonuts

    DrewofDonuts

    Joined:
    Apr 23, 2020
    Posts:
    28
    Feature request!

    A drawing filter, similar to the one demonstrated in the link of a different asset demo. Unfortunately, the asset is not compatible with URP and the developer appears to no longer be active.



    Any thoughts?
     
    Garien likes this.
  18. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    10
    Cloud shadows appears to be rendering after fog - Unity 2022.3.8 and built-in render pipeline... I don't seem to be able to change the order, unless I've missed something?

    upload_2023-11-21_15-21-41.png

    upload_2023-11-21_15-23-49.png
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    may not be able to reproduce it exactly, but its worth trying out combining the Sketch and Edge Detection effects (in that order)

    upload_2023-11-27_8-10-2.png

    This is unfortunately true! In the Built-in RP the Fog effect renders before transparent geometry, whilst the Cloud Shadows effect renders after.

    The CloudShadows.cs file you can change PostProcessEvent.BeforeStack to PostProcessEvent.BeforeTransparent. Which will put both effects in the same queue. After which you can adjust the rendering order on the Post Process Layer camera component (need to toggle it off and on again for this to take effect)
     
  20. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    @StaggartCreations I love your assets -- they just work.

    I notice that screen space effects such as sun shafts are dependent on resolution of the render target. I'm finding that the visual effect displays very differently when a user is running a 1920x1080 resolution vs 4K. Is there a way to normalize output with regard to screen resolution?
     
  21. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thank you!

    This is indeed the case, as it's inherent to the technique its built on. Other effects such as Bloom or Depth of Field exhibit the same effect for the same reason.

    What I have done in a particular project was to alter the Length parameter on the post-processing volume based on the current screen resolution. Where I picked a value to use on 720p and another on 4K, then interpolated between that given the current screen resolution.

    It's not an automatic solution, but it helped towards consistency between screen resolutions.
     
    stonstad likes this.
  22. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    Thank you!
     
  23. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    It would be awesome if there was a checkbox that, if checked, applies this ratio to length and other comparable parameters.
     
    StaggartCreations likes this.
  24. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    10
  25. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    are the clouds shadows still blinking for everyone else? mine blink and stutter like crazy
     
  26. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    10
    Having some issues including the fog shader library in an Amplify Shader. I'm getting shader compile errors (as shown). The shader compiles fine without the include. Apologies if this has been raised and solved in the past but I couldn't find a solution here - can anyone point me in the right direction? This is using Unity 2022.3 and the built in render pipeline.
    upload_2023-12-5_10-13-20.png
    upload_2023-12-5_10-13-47.png
     
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    This shader library unfortunately can't be used with surface shaders, which is what ASE generates. The shader library developed for the post processing effects uses an abstraction to make cross compatibility between the Built-in & Universal Render Pipeline work.

    There's something that Unity's surface shader compiler does that generates faulty shader code in this particular case. Regular vertex/fragment shaders or Shader Graphs work without a hitch.

    I've attempted to overcome this particular issue but it involved trying to solve one error after another with seemingly no end. Hence surface shaders are marked as unsupported for this particular use case.
     
  28. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    10
  29. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    I have a question....

    Is it possible the transform for some of these effects changes in FixedUpdate instead of Update? My camera transform changes in Update (for smooth interpolation) and it looks like the transform for certain effects is updating more slowly. The effect takes a frame or two to catch up. If this is the case, is it possible to configure when the update occurs?
     
  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I believe in both render pipelines the volume blending happens in Update, so any realtime changes to volume settings should be applied the very same frame. I say I'm not sure since this is functionality in Unity's systems.

    Rendering of effects always happens in Update though, that's for certain.

    Some properties, used in effects, such as the camera position are always set up at the start of the frame (which, at a very low level happens in Update). This doesn't rely on the volume system.
     
  31. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    Hey @StaggartCreations Thanks for the reply! Turns out it was related to script order! Thank you!
     
  32. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Discovered something unexpected when I switched from my high DPI MBP to a 1080p external monitor. The sunshafts effectively doubled in length. Is this expected behavior? Do we need to be detecting the screen resolution/DPI and dynamically adjusting the sunshaft settings or is there a better approach?
     
  33. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Please see my earlier post, which is related to the same case: https://forum.unity.com/threads/sc-...dditional-effects.513191/page-16#post-9503902 :)
     
    GoldFireStudios likes this.
  34. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    hopeful likes this.
  35. TGDevs

    TGDevs

    Joined:
    Sep 21, 2023
    Posts:
    1
    Hello, we're having some issues with an error regarding the Fog. After I installed the effects scripts, this popped up. We're working on Unity version 2022.2.13 on the Built-in RP, and yes, I installed the Built-in RP effect scripts SCPostEffects.png
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Apologies, forum notifications expired (as they seemingly do?). I had replied to your email a moment ago.

    Coincidentally, version 2.3.7 was submitted which contains a safeguard such an error occurring.
     
  37. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    An update on development. I touched on a point some 2 years ago that URP was showing signs of branching off in (yet another) different direction. Which in turn warrants structural changes to this asset's code. Namely, the adoption of the Render Graph API.

    It will not be viable to try and incorporate this rework into the current asset's code base. As this then needs to span both the Built-in RP and URP, from Unity 2020.3 through 2023.3 + VR support, that is an immense compatibility matrix. I also feel, that by now, I can say with certainty that the future holds more drastic changes in store. In one word: divergence.

    Hence, moving forward
    • SC Post Effects will remain as it is. It supports both the Built-in RP and URP in Unity 2020.3 through 2023.2.

      It is not deprecated, but after 6 years it is no longer under active development. Yet remains available for projects using these versions.

    • Minor fixed/updates required to provide error-free or bug-free usage will be made for as long as possible.

    • Support for URP with the SC Post Effects asset stops after Unity 2023.2.
    • In Unity 6, Render Graph will have to be disabled to make the effects work.

    • With the release of Unity 6, I will start working a new Post Processing pack asset. This is the successor to SCPE for URP and development for new/improved features will have their home there. This is to cleanly split off URP into a separate asset and to fund development and support for it.

    • A discounted upgrade to this asset will be made available for anyone who purchased a license to SC Post Effects. If you bought SCPE 6 months before its release, upgrading will be free!

    • It's difficult to speak for the future. But I've always maintained for good development run of 3-5 years for assets, with updates and new features being complementary. I don't expect yearly versions/upgrades, not a fan of it, but this will depend on the direction Unity takes.
    An asset such as this has only been made possible thanks to its users, so thank you :) I have taken note of the various feature requests, will which have a new jumping board in the near future
     
    Last edited: May 6, 2024
    Hades714, stonstad and joshcamas like this.
  38. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    18
    Thanks so much for the great asset!

    Small feature request:

    On the Pixelize shader, could there be an option to make the origin of the effect the center of the viewport instead of the bottom left?

    Right now, when tweening the weight/intensity on the Volume, the pixels on the bottom left appear to push the other pixels up and to the right. Even though it's a sort of optical illusion, I'd expect it to feel more natural for the pixels to be pushed outward from the center.

    I don't think it should be tied to the existing "Center Pixel" flag as it might be desirable for the origin to be in the center of a cluster of four pixels and not on a single pixel.
     
    Last edited: Feb 4, 2024
  39. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thank you!

    I understand what you mean. Particularly at very low resolutions (<64px) you can tell the pixels appear to shift from the bottom-left corner towards the top-right.

    This is because the screen's UV coordinates start at the bottom-left (0, 0). The pixelize effect scales and rounds the coordinates, which provides the characteristic effect. So the diagonal shifting is pretty much inherent to the effect itself.
     
  40. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    CausticsOcclusion.png

    Hey, it would be very useful to have caustics occluded by objects.
    Any advice?
    Thanks.
     

    Attached Files:

    Last edited: Feb 15, 2024
  41. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Yes, admittedly this is purposely not done in the effect for the sake of simplicity. The rendering information required for this sort of calculation (both requesting it, and accessing it) is wildly different between the Built-in RP and URP (+ mixing in VR), so accommodating it immediately blows up complexity.

    This is why the effect has a "luminance mask" parameter. Because shadows are typically darker, and lit areas are always brighter, so it can serve as a way to mask the effect in darker areas.
     
    sjm-tech likes this.
  42. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Thank you, Luminance Threshold does something to mitigate shadow but not so much for objects you can see from the bottom.
    I understand it is a specific case. It is on my wish list for the next reworked version of the asset.;)
     
    Last edited: Feb 15, 2024
  43. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,279
    Greetings! Thank you very much for the recent fixes, it solved most of the issues I was having.

    I did notice for some reason it's no longer detecting my skybox, however - the linearDepth > 0.99 check doesn't seem to work anymore for... some reason. However, doing linearDepth > 0.95 does work. Very odd, but easy fix on my end. I'm not sure if this is just some odd setting on my project.

    Again, thanks a ton for all the fixes! I look forward to the new post processing asset once it releases for Unity 6.
     
  44. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Glad to hear it!

    That's odd, the skybox has a maximum depth value, which should put it above 0.99. I suppose it's possible this threshold can shift if the camera's far clip plane is set to a very low value.
     
  45. NightBurger

    NightBurger

    Joined:
    Feb 21, 2016
    Posts:
    1
    @StaggartCreations Hi, I just purchased the pack and am loving it. I'm having some trouble scripting the values like my other volume overrides. I can't seem to be able to access anything. I tried referencing "sc.posteffects.runtime".

    I also couldn't reference SPCE like this linked resource on the documentation demonstrated. I am using the URP version of the asset. I noticed that I don't have this dll in my project but there is the import files for it.
    https://pastebin.com/r4nRkDBw

    Any help will be very appreciated :)

    Edit: Found the dll in 'Library\ScriptAssemblies' but still cant get it to be referenced in my script

    UPDATE/FIX: I restarted Unity and then checked/unchecked override references on the assembly definition in Unity for sc.posteffects.runtime and now I can access SPCE :D
    upload_2024-3-12_0-19-49.png
     
    Last edited: Mar 12, 2024
    StaggartCreations likes this.
  46. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    Like this? Would you change anything?

    Code (CSharp):
    1. using SCPE;
    2. using UnityEngine;
    3. using UnityEngine.Rendering.PostProcessing;
    4.  
    5. public class SCResolutionAdjustment : MonoBehaviour
    6. {
    7.     [Header("Full HD 1920x1080")]
    8.     public float SunshaftsLength = 0;
    9.  
    10.     [Header("Scalar")]
    11.     public float Scalar = 1.0f;
    12.  
    13.     private Sunshafts _Sunshafts;
    14.  
    15.     private int _ResolutionHeight;
    16.     private int _ResolutionWidth;
    17.  
    18.     private void Start()
    19.     {
    20.         PostProcessVolume postProcessVolume = GetComponent<PostProcessVolume>();
    21.         PostProcessProfile profile = postProcessVolume.sharedProfile;
    22.  
    23.         if (profile.TryGetSettings(out Sunshafts sharedInstance))
    24.             _Sunshafts = sharedInstance;
    25.     }
    26.  
    27.     private void Update()
    28.     {
    29.         if (_ResolutionWidth != Screen.width || _ResolutionHeight != Screen.height)
    30.         {
    31.             _ResolutionWidth = Screen.width;
    32.             _ResolutionHeight = Screen.height;
    33.             ApplyChanges();
    34.         }
    35.     }
    36.  
    37.     private void OnValidate()
    38.     {
    39.         ApplyChanges();
    40.     }
    41.  
    42.     public void ApplyChanges()
    43.     {
    44.         if (_ResolutionWidth > _ResolutionHeight)
    45.             Scalar = _ResolutionWidth / 1920.0f;
    46.         else
    47.             Scalar = _ResolutionHeight / 1080.0f;
    48.  
    49.         if (_Sunshafts != null)
    50.             _Sunshafts.length.value = Scalar * SunshaftsLength;
    51.     }
    52. }
    53.  
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I'd say if that works well for you, definitely!

    As an example, I've extracted the code from another project, where the sunshaft length is adjusted between 720p and 4K resolutions, it remains consistent between them. This may prove to be more flexible as it works for ultra-wide resolutions as well.

    Code (CSharp):
    1. using UnityEngine;
    2. using SCPE;
    3. using UnityEngine.Rendering.PostProcessing;
    4.  
    5. public class SunshaftsScalar : MonoBehaviour
    6. {
    7.      private Sunshafts effect;
    8.      [Tooltip("Desired sunshaft length")]
    9.      public float scale = 3f;
    10.    
    11.      [Space]
    12.    
    13.      public int minResolution = 720;
    14.      public int maxResolution = 2160;
    15.    
    16.      private void Start()
    17.      {
    18.          PostProcessVolume postProcessVolume = GetComponent<PostProcessVolume>();
    19.  
    20.          postProcessVolume.profile.TryGetSettings<Sunshafts>(out effect);
    21.          effect.length.overrideState = true;
    22.      }
    23.  
    24.      private void Update()
    25.      {
    26.          var normalizedHeight = ((Screen.height - (float)minResolution) / (float)(maxResolution-minResolution));
    27.          float scalar = 1f + normalizedHeight * (float)(maxResolution / minResolution);
    28.  
    29.          effect.length.value = scale * scalar;
    30.      }
    31. }
     
    stonstad likes this.
  48. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    670
    Thanks, @StaggartCreations! Ultra-wide support is a definite improvement.
     
  49. quadro5567

    quadro5567

    Joined:
    Feb 23, 2022
    Posts:
    4
    it would be nice if we could modified the outline, something like this but instead of just use noise we can use textures instead :
     
    StaggartCreations likes this.
  50. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    18
    I managed to get it mostly working by changing the following:
    Code (csharp):
    1. float x = round((SCREEN_COORDS.x / scale.x) + offset) * scale.x;
    2. float y = round((SCREEN_COORDS.y / scale.y) + offset) * scale.y;
    to this, which makes a big chunky pixel in the middle :
    Code (csharp):
    1. float x = round(((SCREEN_COORDS.x - offset) / scale.x)) * scale.x + offset;
    2. float y = round(((SCREEN_COORDS.y - offset) / scale.y)) * scale.y + offset;
    I can resolve this by changing to floor or ceil instead of round, but then there's a tiny bit of "drift" on the subpixel scaling factors.

    Anyway, I think this is workable for me now, just wanted to share in case other people want to see how it looks/feels vs. the default behavior..
     
    StaggartCreations likes this.