Arvtesh / UnityFx.Outline

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

[URP] Overlay camera also draws outline #55

Open STARasGAMES opened 2 years ago

STARasGAMES commented 2 years ago

URP has a camera stacking feature that allows rendering additional objects on top of the Base camera. For example, this could be used for rendering FPS weapons that don't clip with the environment.

The problem is that the overlay camera also draws the outline. This produces waste draw calls. Moreover, in cases when the overlay camera has a different field of view player will see two(or more) separate outlines which is really weird.

As a solution OutlineFeature could have a setting that forces OutlinePass to render outline only for the base camera. Whether a camera is base or overlay could be found by using this component: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@13.1/manual/universal-additional-camera-data.html

Arvtesh commented 2 years ago

Hey, thanks for the report. Sounds like a useful feature for the next release.