Universal Render Pipeline
Outline objects with just one material. Set up mesh outlines one click. Infinitely customizable.
About
Outline Objects enables you to instantly outline 2D and 3D mesh objects in your Unity game. To apply, you simply drag and drop the outline material into a second material input slot onto any mesh that you would like to receive an outline. Quick, easy, and well-supported.
You can customize your outlines for each mesh. Do you want one object outlined in a thin red line and a second object outlined with a thick blue pulsing line? You got it.
The outline is configured using world space units and is rendered in world space. In other words, you can easily set the exact size of the object's outline in world space units. As objects move closer or further from the camera, the outline remains the same size relative to the object.
You can set any outline color on a per-object (i.e., per material) basis.
You can also use the Vertex Color (R) channel to attenuate the outline thickness for more artistic control. A Vertex Color (R) value of 0 fully attenuates the Outline Thickness, whereas a Vertex Color (R) value of 1 applies no attenuation to the Outline Thickness. An example of this functionality is provided with the VP_Sphere in the demo.
You can also scale the outline size down as objects get further away from the camera if you'd like the effect to only appear for nearby objects.
Finally, you can use a noise texture to attenuate the outline thickness based on the vertex distance from the object center. The noise texture is sampled along the x axis only. The Noise Framerate configures how frequently we jump to a new randomly offset position along the x-axis. Set this to zero to disable offset jumping. The Noise Frequency configures the rate at which the distance samples across the x-axis of the noise texture (e.g., setting frequency to 1 causes the shader to sample at a rate of 1 : 1 in world space units - in other words, 1 unit of distance will be equivalent to 1 repeat of the noise texture).
Shader Properties include the following:
These Shader Properties are all accessible as standard material properties are during runtime, except for the three toggles - _UseVertexColors, _AttenuateByDistance, and _RandomOffset, which are shader feature keywords compiled during build.
How to Install Outline Objects for Unity
1. Import the Stylized Outline asset into your project.
2. Identify an object that you would like to outline in your scene and open it in the Inspector.
3. In the Mesh Renderer component, click the + button under the Materials slot.
4. Drag and drop the M_StylizedOutline
It's easy! Just drag and drop the outline material into a second material input slot onto any mesh you want to give an outline.
Absolutely! You can choose the outline color, thickness, and even use the Vertex Color channel for artistic control.
This Outline Shader extrudes the mesh in the direction of each vertex's normal vector. For hard-edge surfaces like the default cube, the normal vector is perpendicular to the surface along the entire face.
The Outline Shader looks a lot better if the mesh is extruded along the smooth normal direction such that it appears to be scaled.
Typically, smooth normals are stored in the Vertex Color channel. However, the Vertex Color channel is often used for other scenarios - such as attenuating the outline thickness. For this asset, we store the Smooth Normals in the UV3 channel.
This asset offers a tool that enables you to bake the Smooth Normals for your mesh for the best visual results while retaining your Vertex Color data.
Go to Tools -> Generate Smooth Normals, drop in the mesh you want to generate smooth normals for, then hit "Bake". The smoothed normals will be baked to the UV3 channel of the target mesh and a new mesh asset will be created in the project.
Use this new mesh asset for your object.
Go to the Outline material on a mesh with valid smooth normal data in the UV3 channel, then enable the "Use Smoothed Normals" checkbox.
The outline is rendered in world space, so you can set the exact size of the outline in world space units. As objects move closer or further from the camera, the outline remains the same size relative to the object. You can also scale the outline size down as objects get further away from the camera if you want the effect to only appear for nearby objects.
Yes! You can use a noise texture to attenuate the outline thickness based on the vertex distance from the object center.
Most of the Shader Properties are accessible as standard material properties during runtime, except for the three toggles - _UseVertexColors, _AttenuateByDistance, and _RandomOffset, which are shader feature keywords compiled during a build.
The Shader Properties include _OutlineColor, _OutlineThickness, _CompleteFalloffDistance, _NoiseTexture, _NoiseFrequency, and _NoiseFramerate. These properties are all easily accessible during runtime.
Follow these steps:
No, any standard 2D or 3D mesh object can be used with the Outline Objects pack. Simply follow the installation steps above to add an outline to your desired object.
Yes, you can easily customize the outline color and thickness for each object using the _OutlineColor and _OutlineThickness properties in the M_StylizedOutline material.
Yes, you can use the Outline Objects pack with as many objects as you like in your scene. Simply follow the installation steps for each object that you want to give an outline.
As far as we are aware, there are no known issues or compatibility issues with the Outline Objects pack. If you encounter any issues, please don't hesitate to contact us for support.
March 17, 2023
March 16, 2023
February 27, 2023
Outlines now write to the depth buffer for compatibility with other assets like Altos and Buto
Initial release