Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. 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. svansetten

    svansetten

    Joined:
    Dec 6, 2020
    Posts:
    9
    So how can I use the effect (transition) as intented without scripting? That was actually my initial question. How can I apply one of the transitions as shown in your video? If I just can use the transition effect by enabling a gameobject, then I can do the rest with GameCreator actions. It would be nice to have a tutorial or description on how to use the transition effect.
     
  2. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    219
    any idea what could be causing the flickering with the cloud shadows?
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    It looks like the terrain isn't writing into the depth texture, which in turn is what the Sketch effect relies on to work. Why this happens is a question I can't readily answer. But it'd be worthwhile to check the Frame Debugger to see if this is indeed the case and to see what's exactly going on (and in which order).
     
  4. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    219



    So any idea how to stop this flickering with the clouds ?
     
  5. svansetten

    svansetten

    Joined:
    Dec 6, 2020
    Posts:
    9
    Any news?
     
  6. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Animating post process volume parameters still requires scripting, this generally applies to any effect, including Unity's built in effect.

    Making a generic script that just animates the 'progress' parameter (from 0->1, or reversed) is indeed an easy way to go about it. This way GameCreator doesn't need to involve itself with any kind of specific API. I took the liberty to create one here: https://pastebin.com/4VS7YX9u (note that the component itself needs to be toggled, disabling a GameObject means any code stops running as well).

    The same code can be adopted to blend an entire volume in/out, which makes it straightforward to animate any kind of effect (just have to set it up at the full desired intensity).
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using UnityEngine;
    4. using UnityEngine.Rendering.PostProcessing;
    5.  
    6. public class VolumeBlendAnimation : MonoBehaviour
    7. {
    8.     [Tooltip("Assign a volume that has effects set up on it\n\nThey need to be at full intensity")]
    9.     public PostProcessVolume volume;
    10.     [Tooltip("In case the volume should be disabled during edit mode, enable this checkbox to automatically enable it when entering play mode")]
    11.     public bool enableVolumeOnAwake;
    12.     public float fadeTime = 1f;
    13.  
    14.     [Header("Debug")]
    15.     [Range(0f, 1f)]
    16.     public float progress;
    17.    
    18.     void OnEnable()
    19.     {
    20.         if(enableVolumeOnAwake) volume.enabled = true;
    21.        
    22.         StartCoroutine(Fade(false));
    23.     }
    24.  
    25.     private void OnDisable()
    26.     {
    27.         StartCoroutine(Fade(true));
    28.     }
    29.    
    30.     IEnumerator Fade(bool invert)
    31.     {
    32.         var elapsedTime = 0f;
    33.  
    34.         while (elapsedTime < fadeTime)
    35.         {
    36.             elapsedTime += Time.deltaTime;
    37.            
    38.             SetProgress((invert ? 1f-(elapsedTime / fadeTime) : (elapsedTime / fadeTime)));
    39.  
    40.             yield return null;
    41.         }
    42.     }
    43.  
    44.     private void SetProgress(float t)
    45.     {
    46.         progress = Mathf.Clamp01(t);
    47.        
    48.         volume.weight = progress;
    49.     }
    50. }
    There's a section in the documentation regarding scripting, but this generally where the anything asset-specific stops, because scripting is so generic and project specific https://staggart.xyz/unity/sc-post-effects/scpe-docs/?section=scripting-5. If C# is completely foreign to you, it's best to elicit some help from a coder.

    Does any change in effect/camera settings make a difference? Any steps I can follow to reproduce this? I've personally never seen this behaviour before as you're describing it.
     
  7. svansetten

    svansetten

    Joined:
    Dec 6, 2020
    Posts:
    9
    Thanks for your reply! I think I'm almost there. With GameCreator I can toggle/enable/disable a gameobject so that will work. I downloaded your script and tried it to add it to my gameobject with the post-process volume, but got this error, see screenshot in attachment. What could be wrong there?
     

    Attached Files:

  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    The filename of a script needs to be identical to the script's class name. So that would be "TransitionAnimation", you can simply rename it in the project window afterwards, that's no problem.

    Note that when you disable the GameObject, the code responsible for fading out the effect will not execute. Script components only run for active GameObjects. Instead, the component 'enabled' state needs to be toggled on/off.
     
  9. svansetten

    svansetten

    Joined:
    Dec 6, 2020
    Posts:
    9
    Thanks a lot!! This works perfectly!! :):):)

    PS: With GameCreator comes the actions "enable/disable component" so in case you would receive any more questions on if this can be used with GameCreator, you could confirm it is ;)
     
  10. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    219


    here is the gif. You can see the strobing effect. I tried changing camera settings. deferred. Forward. Etc. It just started happening for no reason.


     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Thanks for the video! That illustrates perfectly what you mean.

    Based on the UI layout, it appears you're using a version of the asset older than v2.2.0. This version improves on a technique the Cloud Shadows effect relies on, and fixes flickering under certain conditions (camera being far from the world origin, or looking directly at the X/Z axis).
     
  12. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    I'm trying to use the "Transparent_wFogSupport" shader and it doesn't work, the transparent object still gets hidden by the fullscreen fog. Is there something I need to set up for this to work?
     
  13. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    On the fog render feature there's a “Skip Transparents” option, this must be enabled in that case ;)
     
  14. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Ah, that's unfortunate, because then it doesn't work with a lot of other shaders I use.
     
  15. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    Is it possible to show SC post effects on scene view camera? Scene view settings has post processing enabled but effects do not show. I'm using Unity 2020.3.38f1 and SC Post Effects 2.2.0.
     
  16. PieterM2H

    PieterM2H

    Joined:
    Aug 2, 2021
    Posts:
    8
    Hi there,

    We're getting a weird warning we would like to get rid off:

    CommandBuffer: temporary render texture _MainTex not found while executing
    SCPE.SunshaftsRenderer+SunshaftsRenderPass (SetGlobalTexture)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)

    And the same warning but with:
    SCPE.SunshaftsRenderer+SunshaftsRenderPass (Blit source)

    I'm wondering if we've set it up incorrectly or if Unity is being weird

    URP 12.1.7
    Unity 2021.3.5f1
    SC PP 2.2.0
     
  17. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Effects applying to the scene view would be the default behaviour, if the default Unity effects render the ones from this asset will too.

    There's a few exceptions, like the Blur and Kaleidoscope effects, that are hardcoded to not render in the scene view, since they'd just get in the way.

    In URP this works differently, on the Render Feature there's a dropdown option to select where the effect is allowed to render, by default the scene view will be enabled.

    This is unfortunately some unwanted behaviour related to keeping cross-version compatibility intact for URP. It's ultimately harmless, and will no longer pop up come next version update (this week).
     
    Last edited: Nov 14, 2022
    GreaserMonkey likes this.
  18. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    I just remembered, the camera object needs to have the "MainCamera" tag. The scene view camera always ends up mirroring this particular camera (in terms of components). If no camera has this tag, the scene view won't have post processing enabled.
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    I had the intention on submitting the version 2.3.0 update this week, but I'll be away for the rest of the month on a family visit.

    It's an update that sees fundamental technical changes, needed for future proofing. It's finally passed the long checklists of tests today, but I've decided its best if I'm around to issue any hotfixes should any blocking issues pop up!

    So I'll be sure to submit this version December 1th :)

    The changelog for now:
     
  20. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Version 2.3.0 is now finally available!
    This is a major version update for both the Built-in RP and URP.

    This asset was now released almost 5 years ago (Jan 2018) and has been purchased 2324 times. That it itself makes it existence possible, so thanks for sticking with me :)

    Notable changes:

    Built-in RP: No longer uses Unity's Post-processing package's shader library. This was put in place to support all render pipelines, but that effort seemed to be quickly abandoned. As such, the same library was never fitted with support for Single-Pass Instanced VR rendering.

    Instead, the effect shaders now use the regular Unity shader libraries (that appeared to be perfectly possible). Making full VR support possible.

    URP: A seemingly recurring trend, but Unity 2022.1 saw yet another rug-pull on the rendering API. I can dirty many words on the subject, but the asset has been reworked to support 2022.1+.

    (Unity 2023.2 is said to introduce the Render Graph API to URP, this likely requires yet another rework. It's possible this asset will simply split off into its own URP variant, but will no longer be free due to the amount of work required)

    Updating:

    No breaking changes, though this is a unique process involved. Please see the update guide: https://staggart.xyz/unity/sc-post-effects/scpe-docs/?section=update-guide

    Changelog:

    Minimum supported version is now Unity 2020.3, and URP 10.3.2.

    Shaders are no longer in "Resources" folders, meaning only effects present on volume profiles will be included in a build.
    - The installer that pops up when updating will automatically move them for you.

    Added:
    - Single Pass Instanced VR rendering compatibility for: (Built-in RP requires Unity 2021.2+ for a bug fix)
    * Edge Detection effect
    * Sun Shafts
    * (Built-in RP) Distance fading functionality on effects​
    - Pixelize, popular retro resolution presets. As well as a custom resolution height.

    Changed:
    - (Built-in RP) Shaders now use the default UnityCG shader libraries. This ensures compatibility moving forward with core Unity changes.
    * The Fog.hlsl shader library can now be properly integrated into other shaders.​
    - (URP) Updated framework to use the new RTHandles API. Though mainly to silence any obsolete API warnings.
    - (URP) Effects are now listed in the Frame Debugger using a better readable name.
    - Fog, no longer relies on a hidden camera to capture the skybox color. This removes any overhead related to camera processing (in URP this was already the case).
    - Minor shader optimization for any effect using a blur.
    - Minor shader optimization for the Edge Detection effect.
    - Color Split effect now has an "Edge Masking" parameter.
    - Sunshafts, renamed resolution dropdown values to "Full/Half/Third/Quarter" (the last being a new addition).

    Fixed:
    - (URP) Pre-emptive fixes for Unity 2022.2 & 2023.1.
    - Blur (Gaussian mode) causing a slight discoloration.
    - (Built-in RP) Blur effect not rendering properly when using Single Pass Instanced VR rendering.
    - Texture parameters being blank in a build, unless overridden (they're now overridden automatically when first adding an effect)
    - Caustics effect appearing too bright when using the Gamma color space and HDR
    - (Built-in RP) Color Split effect causing FXAA to stop taking effect.
    - (URP) Resolved any unintentional GC allocations.
    - (URP 13+) Sunshafts, warning about "temporary render texture" being thrown at the start of each frame

    Removed:
    - Retired support for Single Pass Stereo VR rendering since it's been deprecated after Unity 2019.
    - Unnecessary Blit from Blur and Sun Shafts effects.
     
  21. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    10
    Hi there, I was wondering if it's possible to combine the depth and normal edge detection with the luminance edge detection? Currently the option is one or the other as global volumes don't stack.
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Not presently, but that's something that's next on the chopping block. It's been requested before and it definitly has merit!
     
  23. Hiplinc

    Hiplinc

    Joined:
    Oct 31, 2017
    Posts:
    10
    Ohh fantastic! Looking forward to trying it.
     
  24. ok_remi_ok

    ok_remi_ok

    Joined:
    Sep 16, 2014
    Posts:
    9
    Hello,
    I'm currently trying Unity 2022.2f01 to see how viable it would be for our current project. We're making extensive use of this asset and it has been great so far : )
    However, the Edge Detection effect doesn't seem to work properly with transparent materials when the "Skip Transparents" option is checked in the renderer asset. Transparent objects are drawn on top of opaque ones.
    The Edge Detection effect has been added to a global volume. Additionally, disabling post processing for the camera *doesn't* disable the effect (but it does disable Unity's built-in effects).
    I tried it in a new, empty project, using URP 14.0.4.
    Would there be an easy workaround for this issue?
    Thanks!
    . Unity_NUHEcFdmvy.gif
     
  25. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    I checked it out, and that does indeed appear to be the case, but its not intended. Thanks for the headsup!

    It seems to be related to the render texture passed to the effect not contain a depth buffer, breaking the sorting for transparent geometry.

    There's a quick fix for this: in the PostEffectRenderer.cs file, you can change line 46 from
    Code (CSharp):
    1. private bool RequireBufferCopy => is2D || xrRendering
    to

    Code (CSharp):
    1. private bool RequireBufferCopy => is2D || xrRendering || this.renderPassEvent == RenderPassEvent.BeforeRenderingTransparents;
    Effects rendering even though post processing is disabled on the camera appears to be a (new) bug in 2022.2. The renderer always reports post processing as being enabled. In older versions this seems to work correctly. Fingers crossed that gets picked up and fixed in the release version.
     
  26. ok_remi_ok

    ok_remi_ok

    Joined:
    Sep 16, 2014
    Posts:
    9
    Ha, it works, thank you so much!
     
  27. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Hallo,
    I updated SC PostEffects to 2.3.0 and now the Fog effect is black when choosing the Skybox Color as Color Source. (Using URP with Unity 2020.3.14.) Also, I still think Global Density, or at least Distance Density, should be a normal FloatParameter, instead of being clamped between 0 and 1!
     
    Last edited: Dec 13, 2022
  28. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Curious, I'm not seeing this happen in any version. Does the screen simply turn black, or is the fog color black?

    I've played a bit with the settings, and I agree Distance Density should be unclamped, it's needed to achieve extremely dense fog (eg. snow or sand storm). I'll be sure to include this change in next update.
     
  29. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    The fog color. Here are some comparison pictures with different Screen-Space Fog settings:

    Screenshot_2.jpg
    Screenshot_3.jpg Screenshot_5.jpg
    In the pictures above it's always the same skybox, with a custom shader.
    But if I use the standard Procedural Sky shader, it works:

    Screenshot_6.jpg
    Though in any case right now I'm getting a lot of errors:

    Screenshot_1.jpg
     
  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Thanks for providing the screenshots! That indeed seems to be the case. This can be remedied by making the skybox shader double sided, just like the default skybox shader.

    I suppose Unity's internal skybox mesh has its normals facing inwards, whilst the mesh used for the fog shading uses normals facing outwards. Making the shader double-sided will work around this, but I'll be sure to correct this.

    Those errors are rather puzzling, something is instructing render textures to be created with no format at all. It seems you are using URP 12 in Unity 2020.3, is that correct? That unfortunately wouldn't be supported as all the code in this asset assume the normal versioning table (eg. 2020.3 would use URP 10).
     
    ratking likes this.
  31. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    I use Unity 2021.3.14f1 (sorry for the typo above)
     
    Last edited: Dec 16, 2022
  32. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Ah my bad, you mentioned 2020.3 in an earlier post. Seemed odd and daring to have backported URP 12 to it :p

    I've unfortunately never seen these type of errors before, nor am I able to reproduce them under various conditions. A repo project, or repo steps would be most helpful in this case!
     
  33. frotagonist

    frotagonist

    Joined:
    May 15, 2020
    Posts:
    7
    Can you provide an example of how to change the Hue shift 3d intensity at runtime in URP? The example code you provide only has it for radial blur and I'm not sure how to do the same with hue shift 3d

    Edit - Never mind, I got it. It's exactly like in the example code here. https://pastebin.com/r4nRkDBw
     
    Last edited: Dec 28, 2022
  34. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Version 2.3.1 is now available!

    Changed:
    - Fog, distance density parameter is now unclamped in the inspector.
    - Tilt Shift effect no longer requires an intermediate render pass.

    Fixed:
    - (Built-in RP) Shader compile error about "Luminance" function redefinition when using the Metal or Vulkan graphics API
    - (URP) Tilt Shift no longer appearing to have an effect since last update (when HDR is enabled).
    - Script compile error when both the Universal RP and Post Processing packages were installed, preventing a proper installation error from being displayed.
    - Fog turning black if the skybox shader in use was not double-sided.
     
  35. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    In any case I get these errors with both 2.3.0 and 2.3.1 of SC Post Effects. I could pin it down to an incompatibility with "Volumetric Fog And Mist 2" with Terrain Fit enabled (which uses a second camera that renders to a texture, if I'm not mistaken).
    [EDIT] I noticed that the errors vanish if I disable "Skip Transparents" of SCPE Fog Renderer in the URP Renderer settings.[/EDIT]
    [EDIT2]No idea if this is true / helping, but the dev of Volumetric Fog and Mist 2 told me that there's a camera the SCPE Fog Renderer should exclude. "Ideally the renderer should expose a camera layer mask so you can configure it to exclude the zenithal camera by using a different layer." In any case I wonder why there were no problems before 2.3.0, as I don't think that the Fog effect changed.[/EDIT2]

    Apart from this I also get pink materials now for all shaders that use the ApplyFog node, but I don't know if those two issues are connected or not.
     
    Last edited: Jan 5, 2023
  36. frotagonist

    frotagonist

    Joined:
    May 15, 2020
    Posts:
    7
    Noticed an issue with the ripple effect not working when I build the game. It works in the editor, but when I build for mac the effect just makes the screen go black. I use an m1 macbook air with a intel64bit + apple silicon build

    Edit- I fixed it by adding the ripple effect to the list of shaders in the project settings
     
    Last edited: Jan 8, 2023
  37. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    A black screen usually does indicate an effect is rendering without a shader. In a development build an error would be logged in this case.

    The Ripples shader will normally be referenced on the profile component, so that it is included in the build. This happens when first adding an effect to a profile, or when updating to version 2.3.0 for existing profiles (a dialog pops up).

    upload_2023-1-9_11-48-12.png

    It seems the latter never happened in your case. But resetting an effect will also do this.
     
  38. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    @StaggartCreations I'll send you a repro project via PM.
     
  39. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Apart from still having the "gray screen during pause" problem that I still have even with the latest SCPE version (discussed via PM), I experience some more issues:

    - The Speedlines effect works in the editor, but doesn't appear in the build. (Yes, I checked if it's in the correct quality settings etc.)

    - I tried to add my own custom effect by following this tutorial, and it works (it just blends a single color over the screen); but when I use the SCPE Black Bars effect, my custom effect instantly disappears. I just wondered if you could point me into the right direction why this is happening.

    Regards,
    ratking
     
  40. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    The gray screen occurrence is puzzling, yet not something I see occuring across several tests. The Frame Debugger will be more helpful in pinpointing the cause. A gray texture is Unity default "null" texture. It should show the effect getting an correct input image as this:
    upload_2023-1-30_15-52-32.png

    Effects not working in a build is a bit of a localized issue that occured in projects that had any kind of scripting error during the update to v2.3.0, preventing automatic update processes to execute. As a result, the effect's shader is not being included in a build. You can redo this process by going to Help->SC Post Effects and and click the "Unpack Files". You'll see one or more console messages like "
    [SC Post Effects - Automatic update] <effect> shader is now referenced on the <name> profile asset".

    I can't vouch for mixing post processing systems really. Likely trying to change the order of the render features will have a benefitial effect!
     
  41. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Version 2.3.2 is now available!

    Added:
    - (Built-in RP) Support for Fog integration into custom transparent shaders (see updated documentation).

    Changed:
    - (URP) Optimized early-out behaviour for effects. No resources are allocated if any effect shouldn't render.
    - (Built-in RP) Fog now executes before transparent materials render by default.

    Fixed:
    - If the asset was installed through the Package Manager, installer failed to detect URP as installed.
    - (URP) Black screen in a build if a render feature was added, yet no matching volume component was present on any profiles in the project.
    - (URP) Fixes for Shader Graph nodes, these now also use the same shader functions under the hood as the included effects do.
    - (URP) Shader Graph, shader errors when using the "ApplyFog" sub-graph in combination with a "Tiling And Offset" node
     
  42. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    75
    Using Unity 2021.3.7f1 (LTS) and version 2.3.2, we get the following errors on the LUT shader.
    We see the error across 3 different machines, using Windows and macOS.

    Code (CSharp):
    1. Shader error in 'Hidden/SC Post Effects/LUT': 'lerp': no matching 3 parameter intrinsic function; Possible intrinsic functions are: lerp(float|half|min10float|min16float, float|half|min10float|min16float, float|half|min10float|min16float) at Effects/Shaders/SCPE.hlsl(11) (on metal)
    2.  
    3. Shader error in 'Hidden/SC Post Effects/LUT': undeclared identifier 'unity_StereoEyeIndex' at Effects/Shaders/SCPE.hlsl(11) (on metal)
     
  43. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    Curious error! Are you using URP and targeting a VR platform by any chance?

    The error message mentions an "Effects" folder, which no longer exists in this asset (as of May 2020), which is a little worrying.
     
  44. glumleaf

    glumleaf

    Joined:
    Jan 30, 2016
    Posts:
    22
    I'm probably missing something obvious here, but the Skybox Color fog mode doesn't seem to work with a custom skybox gradient shader that I'm using. I've attached the skybox shader in question, it's pretty simple so I'm hoping it's something I've overlooked.

    Basically the shader I'm using creates a vertical gradient between three different colors. For some reason, Skybox Color fog only seems to be grabbing one of the three colors (the horizon color) rather than the entire gradient.

    I just updated from 2.1.7 to 2.3.2, and I didn't have this issue previously. Any ideas?
     

    Attached Files:

  45. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Thanks for the reply. It's truly a mystery you cannot reproduce the gray screen issue during pause. This is a completely fresh URP Core project with Unity 2021.3.17f1, with only SCPE added:
    Screenshot_3.jpg
    The scene has nothing more than a red fog (Skip Transparents is activated) and a box and a plane with a green(!) material.

    Unfortunately this also didn't work. I even removed SCPE completely and added the latest version again. The speedlines just don't appear in my build. [EDIT] At least this issue seems to be a problem in my current project only - the lines appear in the empty test project from above. So I'd say here there error is on my side, sorry![/EDIT]
     
    Last edited: Jan 31, 2023
  46. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    75
    We fully reinstalled the plugin now, and followed the installation instructions and it works!
    Thanks.
     
  47. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    75
    UPDATE / FIX in the bottom!!!

    Now I'm getting

    RenderingCommandBuffer: invalid pass index 1 in DrawMesh
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


    Which goes away if I remove the post-processing volume, or if I disable certain effects like LUT and Fog.
    I've traced it down to when I select any .shader file in the plugin, it tells me in the inspector

    Couldn't open include file '../../Shaders/Pipeline/Pipeline.hlsl'.


    Which is worrying. That file exists and I looked into it, seems to just pipe through to Standard.hlsl. I changed it to just reference Standard.hlsl and the shaders started working and the error disappears. So there's something about the Pipeline.hlsl file that Unity doesn't like, but I have no idea what it could be?

    Changing this line in the shader to /Standard.hlsl seems to work...
    #include "../../Shaders/Pipeline/Pipeline.hlsl"



    Things i've tried that did not affect any change:
    - upgrade unity to latest LTS (2021.3.17)
    - ensure Post Processing stack is latest


    We are using builtin. Error observed on mac and windows.

    !!!! UPDATE / FIX !!!!
    Deleting the UnityProject/Library folder entirely and letting Unity re-import everything worked!
    Problem was definitely on our side with the state of the project.
    Thanks for the support!
     
    Last edited: Feb 1, 2023
  48. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141

    I had a look, and the reason why it's not working is because the mesh to which your skybox shader gets applied has no UV coordinates. Traditionally this is not needed for a skybox shader. I now remember I had the intention of adding UV's to the mesh anyway, but never seemed to write this down :p

    For now, you can change line 41 in your shader from: o.texcoord = v.texcoord; to o.texcoord = v.position;

    Alternatively, in the FogRenderer.cs file you can insert _SkySphere.SetUVs(0, new List<Vector3>(_SkySphere.vertices)); at line 35 to the same effect!

    The skybox geometry is a unit sphere (0.5 meter radius), so the vertex position will be identical to what a UV coordinate or an outward facing normal direction. They'd all be Vector3's with values ranging from -1 to +1. So you can use the (object-space) vertex position as coordinates for gradient or cubemaps.

    Apologies, I missed the part where it specifically resolves around a "paused" state. I know there are some idiosyncrasies in URP's rendering in regards to being in/out play mode, which are being worked around. But it seems pausing the player also needs to be taking into account for the same reason.

    A quick fix you can do in the PostEffectRenderer.cs file is to replace this function (around line 546)

    Code (CSharp):
    1. //Clearing render targets in edit mode makes them null when needed to be used
    2. //Can't explain why exactly this happens, only viable solution is to simply let them linger
    3. protected bool ShouldReleaseRT()
    4. {
    5.     return Application.isPlaying;
    6. }
    with

    Code (CSharp):
    1. protected bool ShouldReleaseRT()
    2. {
    3.     var isPlaying = Application.isPlaying;
    4.  
    5.     #if UNITY_EDITOR
    6.     isPlaying &= !EditorApplication.isPaused;
    7.     #endif
    8.  
    9.     return isPlaying;
    10. }
    The "invalid pass index" error is pretty much a non-descript error that indicates rendering is being attempted with a broken shader, due to a compile error of sorts.

    Your findings are entirely correct though. Unity employs some rather aggressive caching for shaders in recent versions, making false-positive errors possible. Such as errors about missing files that are blatantly there. It has a lot to do with the order in which files are imported.

    The solution is always to force a shader to recompile by re-importing it. Right-clicking on it and choosing "Re-import" or clearing the Library/ShaderCache folder will both do the trick!
     
    glumleaf and ratking like this.
  49. mr_president

    mr_president

    Joined:
    Jun 28, 2015
    Posts:
    22
    Updated from pre-2.3 to 2.3.2, and also stylized water/underwater to latest, and I'm getting an error with the GetFogDensity shader graph node: Shader error in '(shader name)': 'GetFogAlpha_float': output parameter 'factor' not completely initialized at Effects/Runtime/Fog/Fog.hlsl(257) (on d3d11). Happens in both the shader graph, and previously exported shaders.

    Note this was on a sprite shader that was previously using AlphaClipThreshold (setting it to 0 did not fix this problem though), should I be using a different node now?

    Unity 2020.3, URP 10.9.

     
    Last edited: Feb 2, 2023
  50. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,141
    You're right! That's definitely not intended. The error never popped up for me, until I opened the Subgraph just now.

    A quick fix is to add "factor = 0" to this line in the SC Post Effects/Runtime/Fog/Fog.hlsl file. But I'll be sure to correct for this for next update.
    upload_2023-2-6_10-11-24.png