Closed Necka44 closed 2 years ago
I am having the same issue with Unity 2021.3.1f.
I changed the code at lines 185 and 186 adding = new .... ()
` [SerializeField] private ScreenSpaceOutlineSettings outlineSettings = new ScreenSpaceOutlineSettings();
[SerializeField] private ViewSpaceNormalsTextureSettings viewSpaceNormalsTextureSettings = new viewSpaceNormalsTextureSettings(); `
That removes the error but the outline effect still doesn't show up despite selecting the correct layers (default or all) Hopefully it can be solved easily
"It works on my computer."
Jokes aside, I currently don't have access to a reliable Wi-Fi, but will try to make it to a local pub with Wi-Fi in the coming weeks. Will take a look and try to reproduce and fix the eventual error then!
In the meantime, if anyone has this problem and fixes it they can add a pull request.
@Necka44 , I had the same problem until I realized I had "Everything" Selected on the "Outlines Occluder Layer Mask" property. This means all Layers are hidden from the outline render. If you select "None" on "Outlines Occluder Layer Mask" property and "Everything" on the "Outlines Layer Mask" they should show up!
@Necka44 , I had the same problem until I realized I had "Everything" Selected on the "Outlines Occluder Layer Mask" property. This means all Layers are hidden from the outline render. If you select "None" on "Outlines Occluder Layer Mask" property and "Everything" on the "Outlines Layer Mask" they should show up!
Thanks for the suggestion @TylerFerren, but I already have tried this. But then I went back and tried basically changing everything.
What did the trick was to move it from the default Render Pass "Before Rendering Pre Passes" to "After Opaques"
I'm not very good when it comes to rendering technical details so I'm not sure what should be the best practice here. I assumed it was set by default by the dev and it should work like that.
But anyway, now the outlines shows up but it seem that occluder doesn't work.
I have simple layers: Obstacles and Ground (few others, but not relevant) I've set Outline layer to obstacle and Occluder to Ground.
The outlines shows "through" the ground - so something isn't quite right :(
Ok so I managed to make it work completely (from my early tests)
I'm not super familiar with GitHub, but I think I managed to submit a pull request that includes the fixes. It also includes @mamm0n fixes for the main error.
On my side everything works fine out of the box with those fixes (need to remove and add again the render feature as some default settings are altered such as Occluder background color alpha)
@Necka44 thanks for investigating and taking the time to report back. that fixed it for me in 2021.3 with URP 12.1.7. however, in the game view of the editor, there is frequent flickering and geometry sometimes goes black until the game view is focused. there is also occasional ghosting of outlines from previous frames after exiting play mode. it doesn't seem to be an issue while in play mode and i haven't tested it in a build yet either. i'm curious if anyone else is observing the same behavior.
The scene view outlines are not really good looking to be honest, I wished there was an option such as this:
which allows to have the render feature only showing in Game View or Scene or both.
While my fixes above are quite ok, I do have still an issue for the author: If I set my outline layer to Layer 10 only and set my Occlusion layer to Layer 11 only
Objects in Layer 11 are still showing some outlines. Not the same outline as the others, but still there is something, it's a bit strange.
Hello,
I unfortunately can't have the effect to work as I got an error when adding the ScreenSpace Outline effect to the renderer.
It's a clean project in Unity 2022.1.7 (3D URP Core)
I copied the files in the project, enabled the Depth texture option, disabled MSAA and on the renderer I clicked on "add renderer feature" select the "screen space outlines" feature in the list and an error pops straight away in the console (while the outlines doesn't appear and changing any settings has no effect)
Here is the error stack trace:
NullReferenceException: Object reference not set to an instance of an object ScreenSpaceOutlines+ViewSpaceNormalsTexturePass..ctor (UnityEngine.Rendering.Universal.RenderPassEvent renderPassEvent, UnityEngine.LayerMask layerMask, UnityEngine.LayerMask occluderLayerMask, ScreenSpaceOutlines+ViewSpaceNormalsTextureSettings settings) (at Assets/Outlines/Scripts/RendererFeatures/ScreenSpaceOutlines.cs:81) ScreenSpaceOutlines.Create () (at Assets/Outlines/Scripts/RendererFeatures/ScreenSpaceOutlines.cs:195) UnityEngine.Rendering.Universal.ScriptableRendererFeature.OnEnable () (at Library/PackageCache/com.unity.render-pipelines.universal@13.1.8/Runtime/ScriptableRendererFeature.cs:48) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)