{"id":13662227,"url":"https://github.com/Arvtesh/UnityFx.Outline","last_synced_at":"2025-04-25T07:30:58.859Z","repository":{"id":40618974,"uuid":"202990524","full_name":"Arvtesh/UnityFx.Outline","owner":"Arvtesh","description":"Screen-space outlines for Unity3d.","archived":false,"fork":false,"pushed_at":"2023-05-07T11:29:44.000Z","size":1486,"stargazers_count":1273,"open_issues_count":24,"forks_count":91,"subscribers_count":16,"default_branch":"develop","last_synced_at":"2024-10-29T15:17:36.333Z","etag":null,"topics":["image-effects","outline","post-effect","unity","unity3d","unityfx"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arvtesh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-18T10:43:45.000Z","updated_at":"2024-10-26T04:09:10.000Z","dependencies_parsed_at":"2024-01-11T13:20:17.085Z","dependency_job_id":null,"html_url":"https://github.com/Arvtesh/UnityFx.Outline","commit_stats":{"total_commits":337,"total_committers":5,"mean_commits":67.4,"dds":0.4451038575667656,"last_synced_commit":"2654abe205de4e338e1a24160020e474c38fc6a5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvtesh%2FUnityFx.Outline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvtesh%2FUnityFx.Outline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvtesh%2FUnityFx.Outline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvtesh%2FUnityFx.Outline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arvtesh","download_url":"https://codeload.github.com/Arvtesh/UnityFx.Outline/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223988059,"owners_count":17236838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-effects","outline","post-effect","unity","unity3d","unityfx"],"created_at":"2024-08-02T05:01:52.740Z","updated_at":"2025-04-25T07:30:58.850Z","avatar_url":"https://github.com/Arvtesh.png","language":"C#","readme":"# UnityFx.Outline\n\nChannel | UnityFx.Outline |\n--------|-----------------|\nGithub | [![GitHub release](https://img.shields.io/github/release/Arvtesh/UnityFx.Outline.svg?logo=github)](https://github.com/Arvtesh/UnityFx.Outline/releases)\nNpm (core + built-in RP) | [![Npm release](https://img.shields.io/npm/v/com.unityfx.outline.svg)](https://www.npmjs.com/package/com.unityfx.outline) ![npm](https://img.shields.io/npm/dt/com.unityfx.outline)\nNpm (Post-processing v2) | [![Npm release](https://img.shields.io/npm/v/com.unityfx.outline.postprocessing.svg)](https://www.npmjs.com/package/com.unityfx.outline.postprocessing) ![npm](https://img.shields.io/npm/dt/com.unityfx.outline.postprocessing)\nNpm (URP) | [![Npm release](https://img.shields.io/npm/v/com.unityfx.outline.urp.svg)](https://www.npmjs.com/package/com.unityfx.outline.urp) ![npm](https://img.shields.io/npm/dt/com.unityfx.outline.urp)\nNpm (HDRP) | TODO\n\n**Requires Unity 2018.4 or higher.**\u003cbr/\u003e\n**Compatible with [Unity Post-processing Stack v2](https://github.com/Unity-Technologies/PostProcessing/tree/v2).**\u003cbr/\u003e\n**Compatible with [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.1/manual/index.html).**\u003c/br\u003e\n**Compatible with [XR](https://docs.unity3d.com/Manual/XR.html) (Multi Pass, Single Pass Instanced).**\n\n**Please ask any questions and leave feedback at the [Unity forums](https://forum.unity.com/threads/screen-space-outline-effect-for-unity-free.836908/).**\n\n## Synopsis\n![Outline demo](Docs/OutlineSamples.png \"Outline demo\")\n![Outline demo](Docs/MotusOutline.png \"Outline demo\")\n\n*UnityFx.Outline* implements configurable per-object and per-camera outlines. Both solid and blurred outline modes are supported (Gauss blur). The outlines can be easily customized either through scripts or with Unity editor (both in edit-time or runtime).\n\nImplementation is based on Unity [command buffers](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.html), compatible with [Unity Post-processing Stack v2](https://github.com/Unity-Technologies/PostProcessing/tree/v2) and [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.1/manual/index.html), extendable and has no external dependencies.\n\nSupported outline parameters are:\n- Color;\n- Width (in pixels);\n- Type (solid or blurred);\n- Intensity (for blurred outlines);\n- Depth testing;\n- Alpha testing.\n\nSupported platforms:\n- Windows/Mac standalone;\n- Android;\n- iOS;\n- WebGL;\n- Other platforms (untested).\n\nPlease see [CHANGELOG](CHANGELOG.md) for information on recent changes.\n\n## Getting Started\n### Prerequisites\nYou may need the following software installed in order to build/use the library:\n- [Unity3d 2018.4+](https://store.unity.com/).\n\n### Getting the code\nYou can get the code by cloning the github repository using your preffered git client UI or you can do it from command line as follows:\n```cmd\ngit clone https://github.com/Arvtesh/UnityFx.Outline.git\n```\n\n### Npm packages\n[![NPM](https://nodei.co/npm/com.unityfx.outline.png)](https://www.npmjs.com/package/com.unityfx.outline)\u003cbr/\u003e\n[![NPM](https://nodei.co/npm/com.unityfx.outline.postprocessing.png)](https://www.npmjs.com/package/com.unityfx.outline.postprocessing)\u003cbr/\u003e\n[![NPM](https://nodei.co/npm/com.unityfx.outline.urp.png)](https://www.npmjs.com/package/com.unityfx.outline.urp)\u003cbr/\u003e\n\nNpm core package is available at [npmjs.com](https://www.npmjs.com/package/com.unityfx.outline). There are dedicated packages for [Post-processing Stack v2](https://github.com/Unity-Technologies/PostProcessing/tree/v2) and [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.0/manual/index.html). To use the packages, add the following line to dependencies section of your `manifest.json`. Unity should download and link the package automatically:\n```json\n{\n  \"scopedRegistries\": [\n    {\n      \"name\": \"Arvtesh\",\n      \"url\": \"https://registry.npmjs.org/\",\n      \"scopes\": [\n        \"com.unityfx\"\n      ]\n    }\n  ],\n  \"dependencies\": {\n    \"com.unityfx.outline\": \"0.8.5\",\n    \"com.unityfx.outline.urp\": \"0.5.0\",\n  }\n}\n```\n\n## Usage\nInstall the package and import the namespace:\n```csharp\nusing UnityFx.Outline;\n```\n\n### Per-camera outlines (built-in RP)\n![Outline demo](Docs/OutlineEffectInspector.png \"OutlineEffect Inspector\")\n\nAdd `OutlineEffect` script to a camera that should render outlines. Then add and configure as many layers as you need. An outline layer is a group of game objects that share the same outline settings:\n```csharp\nvar outlineEffect = Camera.main.GetComponent\u003cOutlineEffect\u003e();\nvar layer = new OutlineLayer(\"MyOutlines\");\n\nlayer.OutlineColor = Color.red;\nlayer.OutlineWidth = 7;\nlayer.OutlineRenderMode = OutlineRenderFlags.Blurred;\nlayer.Add(myGo);\n\noutlineEffect.OutlineLayers.Add(layer);\n```\nor\n```csharp\nvar outlineEffect = Camera.main.GetComponent\u003cOutlineEffect\u003e();\n\n// This adds layer 0 (if it is not there) and then adds myGo.\noutlineEffect.AddGameObject(myGo);\n\n// Now setup the layer.\nvar layer = outlineEffect[0];\n\nlayer.OutlineColor = Color.red;\nlayer.OutlineWidth = 7;\nlayer.OutlineRenderMode = OutlineRenderFlags.Blurred;\nlayer.Add(myGo);\n```\n\nThis can be done at runtime or while editing a scene. If you choose to assign the script in runtime make sure `OutlineEffect.OutlineResources` is initialized. Disabling `OutlineEffect` script disables outlining for the camera (and frees all resources used).\n\nMultiple `OutlineEffect` scripts can share outline layers rendered. To achieve that assign the same layer set to all `OutlineEffect` instances:\n\n```csharp\nvar effect1 = camera1.GetComponent\u003cOutlineEffect\u003e();\nvar effect2 = camera2.GetComponent\u003cOutlineEffect\u003e();\n\n// Make effect1 share its layers with effect2.\neffect1.ShareLayersWith(effect2);\n```\n\n### Per-object outlines (built-in RP)\n![Outline demo](Docs/OutlineBehaviourInspector.png \"OutlineBehaviour Inspector\")\n\nAdd `OutlineBehaviour` script to objects that should be outlined (in edit mode or in runtime). Make sure `OutlineBehaviour.OutlineResources` is initialized. You can customize outline settings either via Unity inspector or via script. Objects with `OutlineBehaviour` assigned render outlines in all cameras.\n\n```csharp\nvar outlineBehaviour = GetComponent\u003cOutlineBehaviour\u003e();\n\n// Make sure to set this is OutlineBehaviour was added at runtime.\noutlineBehaviour.OutlineResources = myResources;\n\noutlineBehaviour.OutlineColor = Color.green;\noutlineBehaviour.OutlineWidth = 2;\noutlineBehaviour.OutlineIntensity = 10;\n```\n\n### Depth testing\nBy default depth testing is disabled when rendering outlines. This behaviour can be overriden by setting `EnableDepthTesting` flag of `Rander Flags` (either via scripting API or with editor).\n```csharp\nvar outlineSettings = GetComponent\u003cOutlineBehaviour\u003e();\n\noutlineSettings.OutlineColor = Color.green;\noutlineSettings.OutlineWidth = 2;\noutlineSettings.OutlineRenderMode = OutlineRenderFlags.Blurred | OutlineRenderFlags.EnableDepthTesting;\n```\n\n### Alpha testing\nBy default alpha testing is disabled when rendering outlines. This behaviour can be overriden by setting `EnableAlphaTesting` flag of `Rander Flags` (either via scripting API or with editor).\n```csharp\noutlineSettings.OutlineRenderMode = OutlineRenderFlags.EnableAlphaTesting;\n```\n\n### Ignore layers\nWhen adding a `GameObject` to outline collection it is often desirable to ignore child renderers in specific layers (for instance, `TransparentFX`). This can be achieved by settings the `IgnoreLayers` mask in outline settings (or through corresponding API).\n```csharp\nvar outlineSettings = GetComponent\u003cOutlineBehaviour\u003e();\noutlineSettings.IgnoreLayerMask = LayerMask.GetMask(\"TransparentFX\", \"UI\");\n```\n\n### Extensibility\nThere are a number of helper classes that can be used for writing highly customized outline implementations (if neither `OutlineBehaviour` nor `OutlineEffect` does not suit your needs).\nAll outline implementations use following helpers:\n- `OutlineRenderer` is basically a wrapper around `CommandBuffer` for low-level outline rendering.\n- `OutlineSettings` is a set of outline settings.\n\nUsing these helpers is quite easy to create new outline tools. For instance, the following code renders a blue outline around object the script is attached to in `myCamera`:\n\n```csharp\nvar commandBuffer = new CommandBuffer();\nvar renderers = GetComponentsInChildren\u003cRenderer\u003e();\n\n// Any implementation of `IOutlineSettings` interface can be used here instead of `OutlineSettings`.\nvar settings = ScriptableObject.CreateInstance\u003cOutlineSettings\u003e();\n\nsettings.OutlineColor = Color.blue;\nsettings.OutlineWidth = 12;\n\n// Get outline assets instance. In real app this usually comes from MonoBehaviour's serialized fields.\nvar resources = GetMyResources();\n\nusing (var renderer = new OutlineRenderer(commandBuffer, resources))\n{\n  renderer.Render(renderers, settings, myCamera.actualRenderingPath);\n}\n\nmyCamera.AddCommandBuffer(OutlineRenderer.RenderEvent, commandBuffer);\n```\n\n## Integration with Unity post-processing v2.\n[![NPM](https://nodei.co/npm/com.unityfx.outline.postprocessing.png)](https://www.npmjs.com/package/com.unityfx.outline.postprocessing)\n\nInstall the package, add `Outline` effect to `PostProcessProfile`'s overrides list. Configure the effect parameters, make sure outline resources and layer collection are set:\n\n![Post processing outlinesettings](Docs/PpOutlineSettings.png \"Post processing outlinesettings\")\n\nAssign the configured `PostProcessProfile` to `PostProcessVolume` and that's it!\n\nMore info on writing custom post processing effects can be found [here](https://docs.unity3d.com/Packages/com.unity.postprocessing@2.3/manual/Writing-Custom-Effects.html).\n\n## Integration with Universal Render Pipeline (URP).\n[![NPM](https://nodei.co/npm/com.unityfx.outline.urp.png)](https://www.npmjs.com/package/com.unityfx.outline.urp)\n\nInstall the package, add `OutlineFeature` to `ScriptableRendererData`'s list of features. Configure the feature parameters (make sure outline resources reference is set). Outline objects can be selected by layer or explixitly using `OutlineLayerCollection`:\n\n![URP outline settings](Docs/UrpOutlineSettings.png \"URP outline settings\")\n\nEnable depth texture rendering in `UniversalRenderPipelineAsset` and that's it!\n\n### Integration with High Definition Render Pipeline (HDRP).\n[![NPM](https://nodei.co/npm/com.unityfx.outline.hdrp.png)](https://www.npmjs.com/package/com.unityfx.outline.hdrp)\n\nTODO\n\n## Motivation\nThe project was initially created to help author with his [Unity3d](https://unity3d.com) projects. There are not many reusable open-source examples of it, so here it is. Hope it will be useful for someone.\n\n## Documentation\nPlease see the links below for extended information on the product:\n- [Unity forums](https://forum.unity.com/threads/screen-space-outline-effect-for-unity-free.836908/).\n- [CHANGELOG](CHANGELOG.md).\n- [SUPPORT](.github/SUPPORT.md).\n\n## Useful links\n- [A great outline tutorial](https://willweissman.wordpress.com/tutorials/shaders/unity-shaderlab-object-outlines/).\n- [Command buffers tutorial](https://lindenreid.wordpress.com/2018/09/13/using-command-buffers-in-unity-selective-bloom/).\n- [Gaussian blur tutorial](https://www.ronja-tutorials.com/2018/08/27/postprocessing-blur.html).\n- [Excellent post-processing tutorial](https://catlikecoding.com/unity/tutorials/scriptable-render-pipeline/post-processing/).\n\n## Contributing\nPlease see [contributing guide](.github/CONTRIBUTING.md) for details.\n\n## Versioning\nThe project uses [SemVer](https://semver.org/) versioning pattern. For the versions available, see [tags in this repository](https://github.com/Arvtesh/UnityFx.Outline/tags).\n\n## License\nPlease see the [![license](https://img.shields.io/github/license/Arvtesh/UnityFx.Outline.svg)](LICENSE.md) for details.\n","funding_links":[],"categories":["C\\#","Open Source Repositories","C#","Outline"],"sub_categories":["Effect-Highlighter"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArvtesh%2FUnityFx.Outline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArvtesh%2FUnityFx.Outline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArvtesh%2FUnityFx.Outline/lists"}