Skip to main content
You can add your own effects to Pixelate Pro. A custom effect appears in the Add Effect menu next to the built-in ones, works with Style Profiles and per-asset overrides, and runs in both the Preview and Export. This page is for programmers. You need to be comfortable writing Unity editor C# and assembly definitions.

How an effect works

An effect is a ScriptableObject class that inherits PixelateEffect. It has three jobs:
  1. Hold settings as serialized fields. Pixelate Pro draws them in the Inspector, with override checkboxes in Pixelate Assets.
  2. Validate its settings and report problems the user can act on.
  3. Process pixels of each frame, deterministically.
It must not touch the scene, edit the source’s renderers or materials, or write files. Pixelate Pro handles capture, preview and export.

Set up an assembly

Put your code outside the Pixelate Pro folder, so updates to Pixelate Pro never overwrite it:
YourStudio.PixelateEffects.asmdef

A complete effect

This effect reduces each color channel to a few levels.
PosterizeEffect.cs
After Unity compiles, Posterize appears in Add Effect under Stylization. Adding it from a Pixelate Asset adds it to that asset’s Style Profile, because profiles own the effect list.

The menu attribute

If two loaded effects share a stableId, Pixelate Pro reports an error naming both types.

Where your effect runs

Built-in effects use these positions, so you can place yours before or after them: The Inspector always lists effects in this order, so users see yours where it runs.

Processing pixels

ProcessPixels is called for every Unlit and Lit frame of the Preview, Export and Save GIF, at your effect’s position. Normal previews and normal-map exports skip it. Effects that don’t override it add no processing step. PixelateEffectPixelContext gives you: Keep processing deterministic: the same input must always give the same output, so the Preview matches Export and re-exports don’t change unrelated pixels.

Validation

Override Validate for setup problems the user can fix. Pick the severity by impact:
  • Error: blocks export. Missing required assets, impossible settings.
  • Warning: allowed but probably unintended, such as a setting that makes the effect do nothing.
  • Info: optional guidance.
Always say how to fix the problem in the second argument. Pass your stableId and the serialized field name so the message shows next to the right field.

Inspector

Pixelate Pro draws your serialized fields with Unity’s standard property drawers, including [Tooltip], [Range] and [Min]. Give every field a tooltip. Asset inspectors add the override checkbox for each field automatically. Don’t store foldout or other UI state on the effect; Pixelate Pro keeps that per user in editor preferences.

Renaming fields after you ship

Per-asset overrides remember fields by name. When you rename a serialized field, add [FormerlySerializedAs] with the old name. Pixelate Pro reads it and moves existing overrides to the new name:
If an override points at a field that no longer exists, validation reports it with the field name. For removed fields or larger changes, plan how existing overrides migrate, and never reuse an old field name for a different meaning.

Limits

Only the types used on this page are supported extension API: PixelateEffect, PixelateExtensionMenuAttribute, PixelateExtensionCategories, PixelateExtensionPhase, PixelateEffectPixelContext and PixelateValidationMessage. Other Pixelate Pro types, including custom Inspector drawing and GPU processing, are internal and may change between versions.