Skip to content

Plugin Settings

Ryan Sweeney edited this page May 10, 2024 · 16 revisions

v1.2 Settings

Enable

Global enable for the plugin.

Automatic Resize

Automatically resize the distance field render target. Can alternatively use the UpdateResolution function found in the subsystem or if in the editor, the refresh icon in the top right

Active Stencil Check

Runs an extra pass to automatically detect what stencils are present in the viewport. Distance Fields that use a render target as a source are exempt from this.

Distance Field Configs

This array sets up which stencils to use and what kind of outline type is required.

- Enable

Local enable for the specific distance field pass.

- Outline Source

Enum that selects which source to use for the creation of the distance fields

  • Stencil
  • Render Target

- Stencil Source Config

Shown if Outline Source is Stencil. The stencil in question is the depth/stencil buffer.

-- Use Stencil Group?

Whether or not to use a specified stencil group.

-- Stencil (Group) Index

The index of the stencil to use or the index of the stencil group if enabled.

- Render Target Source Config

Shown if Outline Source is Render Target. The render target is a render target asset that can be selected in the content window.

-- Source Texture

The source texture is what will be used for the creation of the distance field. Similar to the stencil. This needs to be a solid colour on the red channel.

-- Source Process Mask Texture

An optional process mask that can be used to dictate which pixels to be calculated. It can help improve the performance.

- Outline Type

  • Simple - outline is your standard 2px outline. It's much faster than the distance field however you can't do too much with it. It uses the distance field texture but only has values of 0 for the edge and 1 everywhere else.
  • Distance Field - generates the proper distance field. Values range from 0 (the edge) to 1, the furthest in UV space.

- Update Frequency

  • Every Frame - updates the distance fields on every frame that gets rendered.
  • Target Frame Rate - updates based on the target frame rate in seconds. This is calculated based on the render pass and only runs an update when the current elapsed time is greater than the target rate.
  • On Demand - requires an update request. More useful for offline situations or any situation where the update might not occur more than once a second.

- Distance Field Config

Shown only if Outline Type is Distance Field. The general configuration settings for a distance field outline.

-- Extra Passes

Specifies the number of extra passes to render. Generally, this should be fine at 0 but if a little extra quality is needed, this can be increased.

-- Smooth Pass

Runs an extra pass that performs a simple box blur on the distance field.

-- Process Mask Size

By downsampling the stencil buffer, the result can be used to then indicate an early exit for the Distance Field or Simple outline passes.

-- Max Pixel Distance

Limits the number of passes and in doing so only creates a distance field that extends the specified distance while improving performance. Note: If you pass in a value higher than the screen resolution, it will default to full resolution.

-- Optimisation Method

  • None - Standard passes
  • Half JFA - cuts the number of pixels processed by 75% and thus improves performance albeit at the cost of accuracy. The accuracy closer to the line edge is worse but is fine at larger distances.
  • Checkerboard JFA - Like the half JFA this only cuts down the pixels processed by 50%.

--Scaling Config

Options for downscaling the distance field outline. This can work alongside the optimisations however they perform after the downscaling.

--- Downsample Scale

Percentage of the full resolution - 1 being 100%

--- Scaling Sample Filter

  • Nearest
  • Bi-linear
  • Tri-linear

How to sample the downscaled texture during the initial outline (distance field seeding) operation.

--- Scaling Threshold

Used for the distance from the target value (1 if using a render target or the stencil value if using the stencil buffer as a source) both above and below. Can shift the edge inwards or outwards.

Stencil Groups

Each stencil group represents individual stencil values. When grouped and used, the first value in the group is what all the values in the group will be set to. Example: group [1, 2, 5, 7] and [3, 6, 9, 10] any pixels with a stencil value represented by these groups will be set to 1 and 3 respectively.


v1.1 Settings

Enable

Global enable for the plugin.


Automatic Resize

Automatically resize the distance field render target. Can alternatively use the UpdateResolution function found in the subsystem or if in the editor, the refresh icon in the top right


Distance Field settings

This array sets up which stencils to use and what kind of outline type is required.

Enable

Local enable for the specific distance field pass.

Stencil Index

The stencil that is used to generate the distance field.

Outline Type

  • Distance Field - self-explanatory.
  • Single Pixel Inside - uses a very fast shader pass to generate an outline a single pixel thick just inside of the stencil.
  • Single Pixel Outside - like above except just outside.
  • Double Pixel - a combination of both single-pixel options.

Process Mask Size

By downsampling the stencil buffer, the result can be used to then indicate an early exit for the Distance Field or Simple outline passes.

Notes:

  • Each downsample pass also extends the coverage as opposed to being a direct downsample.
  • Low screen resolutions may incur a performance penalty, so test appropriately.
  • If this setting is set on any Distance Field entry, all simple outlines (Single/Double) will automatically use this as the cost would be "free". The value for those will also be set to the lowest value.

Max Pixel Distance

This is an optimisation for the Distance Field outline type. It limits the number of passes and in doing so only creates a distance field that extends the specified distance while improving performance.

Note: If you pass in a value higher than the screen resolution, it will default to full resolution.

Half JFA

This is an optimisation for the Distance Field outline type. The pass is run at half resolution then upscaled and smoothed for the final result. Good for soft or extra thick outlines.