What is Effect Localization?
Localization allows you to apply post-process effects to specific parts of your scene rather than the entire view. This enables creative effects like:
- Making only certain objects glitchy while the rest is normal
- Applying stylized effects to characters but not environment
- Creating split-screen effects with different looks
- Isolating effects to UI elements
Object Space Localization
Apply effects only to specific objects using the Custom Depth Stencil buffer.
Setup
- Select the actor(s) you want to affect
- In Details panel, search for "Custom Depth"
- Enable "Render CustomDepth Pass"
- Set a Custom Depth Stencil Value (1-255)
- In your AOS material instance, enable "Use Object Localization"
- Set the "Stencil Value" to match your actor's value
Stencil Values
Organize your stencil values:
- 1-50: Main characters
- 51-100: Enemies/NPCs
- 101-150: Interactive objects
- 151-200: Environmental effects
- 201-255: UI/Special effects
Include vs Exclude Mode
- Include: Effect ONLY applies to marked objects
- Exclude: Effect applies to EVERYTHING EXCEPT marked objects
Use Cases
- Damaged Enemies: Glitch effect on low-health enemies
- Hacked Objects: Chromatic aberration on hacked items
- Spectral Characters: Ethereal effects on ghosts
- Shield Effects: Distortion on shielded characters
Screen Space Localization
Divide the screen into regions with different effects.
Setup
- Enable "Use Screen Space Localization" in material instance
- Define region using UV coordinates (0-1 range)
- Set shape: Rectangle, Circle, or custom mask
- Adjust feather/softness of the edge
Region Parameters
- Center: UV coordinates of region center (X, Y)
- Size: Width and height of region (0-1)
- Feather: Edge softness (0 = hard edge, 1 = very soft)
- Invert: Apply effect outside the region instead
Example Configurations
Top-Left Quarter:
Center: (0.25, 0.25)
Size: (0.5, 0.5)
Shape: Rectangle
Center Circle:
Center: (0.5, 0.5)
Size: (0.3, 0.3)
Shape: Circle
Feather: 0.2
Right Half:
Center: (0.75, 0.5)
Size: (0.5, 1.0)
Shape: Rectangle
Use Cases
- Binoculars/Scope: Circular region in center
- Damaged Screen: Effect in corners only
- Split Screen: Different effect on each half
- Vignette Alternative: Inverted circle for edge effects
- UI Separation: Different treatment for UI regions
Depth-Based Localization
Separate foreground from background using scene depth.
How It Works
- Uses scene depth buffer to determine distance
- Define a depth threshold value
- Objects closer than threshold = foreground
- Objects farther = background
Setup
- Enable "Separate Background" in material instance
- Adjust "Depth Threshold" slider
- Preview to ensure correct separation
- Apply different effects to each layer
Use Cases
- Atmospheric Fog: Effect increases with distance
- Focus Effects: Blur background, keep foreground sharp
- Cinematic Depth: Film effects on background, clean foreground
- Weather Effects: Fog/haze on distant objects only
Niagara-Based Localization
Use Niagara particle systems to control where effects appear.
How It Works
- Place Niagara particle system in scene
- Particles define effect locations
- Effect renders only where particles exist
- Animate particles to move effects around
Setup
- Use provided AOS Niagara systems
- Configure emitter spawn location
- Link to corresponding effect material
- Adjust particle lifetime and behavior
Use Cases
- Moving Glitches: Glitch travels across screen
- Impact Effects: Distortion at projectile hit points
- Energy Fields: Effect follows energy sphere
- Temporal Rifts: Growing/shrinking effect regions
Combining Localization Types
You can combine multiple localization methods:
Example: Damaged Robot Enemy
1. Object Space: Target the robot with stencil value 50
2. Screen Space: Add screen shake effect to center region
3. Niagara: Emit sparks particles from damaged areas
4. Result: Glitch effect only on robot, intensifying
near damage points, with screen distortion when close
Performance Impact
Localization affects performance differently:
- Object Space: Minimal cost, uses existing stencil buffer
- Screen Space: Low cost, simple UV math
- Depth-Based: Very low cost, uses existing depth buffer
- Niagara: Moderate cost, depends on particle count
Best Practices
- Plan Your Stencil Values: Create a chart of what values mean what
- Use Feathering: Hard edges can look unnatural
- Test Edge Cases: What happens at borders between regions?
- Consider Camera Movement: Effects move with screen space, not world
- Document Your Setup: Complex localization needs good notes