Arvtesh / UnityFx.Outline

Screen-space outlines for Unity3d.
MIT License
1.26k stars 90 forks source link

Warnings spamming the console on Unity 2020.2 #26

Closed dnlbschff closed 3 years ago

dnlbschff commented 3 years ago

I am getting warnings in the editor when not in play mode every frame (as long as I move the camera).

You can only call cameraDepthTarget inside the scope of a ScriptableRenderPass. Otherwise the pipeline camera target texture might have not been created or might have already been disposed.

This is caused by line 66 in OutlineFeature.cs:

_outlinePass.Setup(renderer.cameraColorTarget, renderer.cameraDepthTarget);

I assume it has to do with this https://forum.unity.com/threads/rendererfeatures-not-getting-camera-target-source-in-urp-10.973566/ Now I've seen you found this link already in connection with #21 but 0.8.2 does not seem to fix this. The fix seems to be intuitive, instead of passing the two targets separately to the OutlinePass.Setup, pass only the reference to the renderer instead. Then access the targets through the renderer in the Execute method.

Let me know if I am mistaken and this problem is on my end. Anyways thanks for this awesome piece of software. Cheers

Arvtesh commented 3 years ago

Hello, this should be some kind of UPM cache issue. This bug has been fixed in 0.8.2. In fact, OutlineFeature doesn't contain the code mentioned above any more. Please try to clear Unity package cache and/or reinstall the outline package.

dnlbschff commented 3 years ago

Indeed, you were absolutely right. I probably messed with things by having the file open in Rider when updating packages.