How an effect works
An effect is aScriptableObject class that inherits PixelateEffect. It has three jobs:
- Hold settings as serialized fields. Pixelate Pro draws them in the Inspector, with override checkboxes in Pixelate Assets.
- Validate its settings and report problems the user can act on.
- Process pixels of each frame, deterministically.
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
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
OverrideValidate 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.
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:
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.