https://github.com/Facepunch/Facepunch.Highlight
Mesh outline effect
https://github.com/Facepunch/Facepunch.Highlight
Last synced: 12 days ago
JSON representation
Mesh outline effect
- Host: GitHub
- URL: https://github.com/Facepunch/Facepunch.Highlight
- Owner: Facepunch
- License: mit
- Created: 2018-08-17T11:13:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T09:20:50.000Z (over 6 years ago)
- Last Synced: 2024-07-13T00:06:40.308Z (10 months ago)
- Language: C#
- Size: 12.7 KB
- Stars: 317
- Watchers: 21
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity3d - Facepunch.Highlight - Mesh outline effect (Open Source Repositories / Effect-Highlighter)
- awesome-opensource-unity - Facepunch.Highlight - Mesh outline effect. (Open Source Packages / Effect and Shaders)
- awesome-unity-open-source-on-github - Facepunch.Highlight - Mesh outline effect (Outline)
- awesome-unity3d - Facepunch.Highlight - Mesh outline effect (Open Source Repositories / Effect-Highlighter)
- awesome-unity3d - Facepunch.Highlight - Mesh outline effect (Open Source Repositories / Effect-Highlighter)
README
# Facepunch.Highlight
Mesh outline effect



# UsageAdd Highlighter.cs to your camera (or anywhere else and set the camera reference). There's some static functions that will make things easier if you're only using one type of outline.
```
Highlight.ClearAll();
Highlight.AddRenderer( HoveredRendererer );
Highlight.AddRenderer( SomeOtherRendererer );
Highlight.Rebuild();
```Optimally you should only update the a highlighter when things change, not every frame, but it's not going to kill you if you do.
# Pros And Cons
Pros | Cons
-----|------
Can add multiple highlighters for different line colours/widths | Only one line colour/width per highlighter
Only costs perf when being used | Only works in deferred render mode
No need to add components to all your renderers | Needs depth texture generation on camera
Only re-renders the target objects | Transparent stuff won't occlude
Doesn't need to render potentially occluding objects |
Can draw occluded lines a different colour |
Lines can glow and bloom by providing a HDR color |
Lines can get anti-aliased by post process |
You can edit the shader to do whatever you want |
Works on skinned meshes |
MIT license |