Outlines

The outline implementation uses an inverse hull extrusion method, which creates outlines by duplicating and extruding the mesh along its vertex normals. This approach is efficient and widely used, but it's important to understand that the solutions provided are per-object implementations designed to complement the main shader functionality.

While this works well for many common use cases, there are certain limitations:

  • As a per-object solution, each outlined object requires an additional draw call

  • Some vertices may split (SEE SOLUTION IN THE NEXT POINT)

  • Performance scales linearly with the number of outlined objects

If your project requires advanced outline solutions (such as global screen-space outlines, perfect outline continuity across multiple objects, or specialized edge detection), consider dedicated outline-specific assets that focus solely on this problem domain and provide post-processing outline solutions like Linework.

All In 1 3D Shader offers outlines as part of its comprehensive feature set, but specialized outline assets may provide more robust solutions for projects where outlines are a critical visual element.

Handling Sharp Corners and Non-Smooth Meshes

Since the outline uses inverse hull normal extrusion, the quality of the outline depends directly on the mesh's vertex normals. Meshes with sharp corners or flat-shaded normals can create gaps in the outline where vertex normals point in drastically different directions:

Solution: Smooth Shading + Flat Normals Effect

To achieve clean outlines while maintaining a flat-shaded or faceted look for your lighting:

  1. Set your mesh to Shade Smooth in your 3D modeling software or Unity (in the Mesh Import settings set the Normals to Calculate, the Smoothness Source to Angle, then choose some Smoothing Angle and press Apply. For better results try different Smoothing Angle values)

  1. Enable the Flat Normals effect in the shader

  2. Adjust the Flat Normals intensity slider to control how faceted the lighting appears

This approach gives you the best of both worlds:

  • Smooth vertex normals for clean, gap-free outline extrusion

  • Flat-shaded appearance for stylized or low-poly aesthetics

  • Full control over the degree of flatness through the adjustable slider

Here in the left we have the setup we just described, while on the right we have the regular flat shading + non smoothed normals you'll find in popular asset packs such as Synty ones:

The Flat Normals effect recalculates surface normals per-pixel to create a faceted lighting appearance while preserving the smooth vertex normals used for outline generation.

Outline Types

The shader offers four different outline methods, each with its own advantages and use cases:

None

Disables the outline effect entirely. Use this option when you don't need outlines or want to temporarily disable them without losing your settings.

Simple

A fixed basic implementation that extrudes the mesh along its vertex normals by a customizable width. This is the most common and versatile outline type, suitable for most use cases where a consistent outline is desired. The outline width remains constant in object space.

Constant

Creates an outline with constant screen-space width regardless of the object's distance from the camera. This is particularly useful for UI-like elements in 3D space or for maintaining consistent outline visibility at any distance. Objects retain the same outline thickness whether near or far from the camera.

Fade With Distance

An outline that becomes more visible as objects get closer to the camera and fades when far away. This creates interesting effects where objects only show prominent outlines when within interaction range, helping guide player attention to nearby interactive elements.

Outline Modes

Each outline type supports two rendering modes that control how the outline appears:

Simple Mode

The shader extrudes an outline-colored mesh behind the original mesh. This is the most straightforward approach and works well for most cases, though the outline may appear on both the silhouette and internal edges visible from certain angles.

Clean Mode

Uses the stencil buffer to prevent the outline from appearing on top of the mesh surfaces. The outline only renders around the silhouette where the mesh edges meet the background, creating a cleaner appearance. This mode is ideal for detailed meshes where internal edges would otherwise create visual clutter.

URP Setup

For URP projects, the outline feature requires specific Render Features in your pipeline settings:

The asset will prompt you to auto-configure these features when you first import it if URP is detected. You can also manually configure the pipeline settings at any time through the Asset Window under URP Settings → Configure:

Last updated