Spatial Media
Infrastructure.
MatStream is a zero-latency, material-first Unreal Engine middleware designed to dynamically stream digital banners, videos, and dynamic RTB campaigns straight into your game's material pipelines asynchronously.
Architecture Tiers
Standalone RTB
Direct integration from Unreal Engine client straight to OpenRTB demand networks (Unity Ads, BidMachine, Appodeal). 100% decentralized, zero MatStream cloud accounts required.
CDN & Scheduling
Unlocks dashboard-managed custom campaigns, precise spatial geo-targeting, dynamic player analytics pipelines, and dynamic QR fallback routing globally.
Architecture Recommendation
For production game releases, we highly recommend utilizing **MatStream Cloud** to enable global campaign scheduling and spatial analytics, ensuring your studios can monitor user impressions in high definition.
Spatial Telemetry
Unlike primitive web impressions, MatStream tracks physical placement geometry and frustum positioning directly on the GPU/CPU to measure absolute engagement metrics within 3D coordinate space.
View Distance
EUCLIDEAN_METRICMeasures actual relative player-to-actor distance to avoid awarding empty impressions at extreme ranges.
Camera Dot Product
VIEW_DOT_PRODCalculates cosine view alignment. If the player camera normal and the material surface normal face away, rendering calculations stop.
Frustum Occupancy
SCREEN_OCCUPANCYCalculates percentage of screen space covered by the material instance, detecting if it is obscured by geometry.
Dwell Time
ACTIVE_SLA_DWELLCumulative milliseconds where Euclidean distance and camera angle overlap with active engagement criteria.
Installation
Download uplugin Package
Fetch the pre-compiled binaries of the plugin or clone the repository directly. Place the folder inside your project's root `Plugins` directory:
Enable inside Unreal Editor
Launch your `.uproject` editor. Navigate to **Edit -> Plugins**, find **MatStream Live Interface** inside the Installed plugins category, check the Enable box, and restart the Unreal Engine editor.
# 1. Go to our Epic Games Fab Listing
# URL: https://www.fab.com/portal/listings/ec2fbc34-4c69-4a3b-8b3a-b067f05f9aae/preview
# 2. Add MatStream to your Vault for Free
# 3. Open the Epic Games Launcher -> Unreal Engine -> Library
# 4. Find MatStream in your Vault and click "Install to Engine"
# 5. Open your Unreal Project, go to Edit -> Plugins
# 6. Search for MatStream, check the box to Enable, and Restart the Engine.Authentication & API Key
Every project on MatStream Cloud has a unique API Key (UUID format) that authenticates all network requests from your Unreal Engine plugin to the MatStream backend. Without a valid key, the server will reject all ad delivery and analytics requests with a 401 Unauthorized response.
Find your API Key in the Dashboard
Log in to your Studio Console, select your project, and open the Overview tab. In the right-side SDK Configuration Console panel, you will see a Project API Token field with a copy button. This is your secret key.
Paste it into Unreal Engine Plugin Settings
In the Unreal Editor, go to Edit → Project Settings → Game → MatStream. Paste your API Key into the API Key field. The plugin will automatically send it as a Authorization: Bearer <key> header on every request.
Keep your API Key Private
Your API Key grants full access to your project's ad delivery pipeline. Never commit it to a public repository or share it with untrusted parties. If compromised, contact support to regenerate your key — this will invalidate the old one immediately.
// MatStream automatically reads the APIKey from UMatStreamSettings
// and attaches it to every HTTP request to the MatStream backend.
const UMatStreamSettings* Settings = GetDefault<UMatStreamSettings>();
if (Settings && !Settings->APIKey.IsEmpty())
{
Request->SetHeader(
TEXT("Authorization"),
TEXT("Bearer ") + Settings->APIKey
);
}
// The backend validates this token against the project's stored apiKey.
// An invalid or missing key returns HTTP 401 Unauthorized.Global Settings
Configure your dynamic endpoints and API credentials globally inside the Project Settings under the Game - MatStream category. This will save the values to DefaultEngine.ini automatically.
[/Script/MatStream.MatStreamSettings]
; ── Authentication ──────────────────────────────────────────────────
; Your project API Key from Dashboard → Overview → SDK Configuration
APIKey="your-api-key-uuid-from-dashboard"
; ── Telemetry ───────────────────────────────────────────────────────
bEnableSpatialTelemetry=True
TelemetryReportIntervalSeconds=0.500000
; ── Project Identification ──────────────────────────────────────────
; MatStreamProjectKey is the Project ID (not the API Key)
MatStreamProjectKey="your-project-id-uuid"
DefaultDeliveryProvider=MatStream
; ── CDN and network fallback ────────────────────────────────────────
bDownloadAsyncTextures=True
DynamicFallbackQRUrl="https://matstream.live/fallback"
; ── Local caching ───────────────────────────────────────────────────
bEnableLocalCache=True
MaxCacheSizeMb=256C++ Zone Component
The core logic resides in UMatStreamZoneComponent. By attaching this C++ component to any static or dynamic mesh actor, the engine creates a Dynamic Material Instance (DMI) and begins streaming remote materials asynchronously.
// Spawn and configure the MatStream component inside your own Actor C++ class
#include "MyGameAdActor.h"
#include "MatStreamZoneComponent.h"
AMyGameAdActor::AMyGameAdActor()
{
// 1. Programmatically attach the MatStream component at construction
MatStreamZone = CreateDefaultSubobject<UMatStreamZoneComponent>(TEXT("MatStreamZone"));
// 2. Set the Zone ID — must match the Zone ID in your MatStream Dashboard
MatStreamZone->ZoneID = TEXT("zone_your_zone_id_here");
// 3. Target the correct material slot on your mesh
// If your mesh has multiple materials (Element 0, 1, 2...)
// set TargetMaterialIndex to match the slot with your ad material.
MatStreamZone->TargetMaterialIndex = 0;
// 4. (Optional) If the Actor has multiple mesh components,
// specify which one by name to avoid ambiguity.
MatStreamZone->TargetComponentName = TEXT("StaticMeshComponent0");
// 5. Name of the Texture parameter inside your Material
MatStreamZone->MaterialTextureParamName = TEXT("AdTexture");
}Material & Actor Setup
Creating the code is only half the battle. To render the streamed media perfectly in Unreal Engine, you must construct a dynamic-compatible material asset and align your Mesh actor coordinates precisely inside the Unreal Level Editor.
Create your Base Material
Right-click in your Content Browser, select **Material**, and name it `M_MatStream_Base`. Double-click to open the Material Graph.
Define the Texture Parameter
Add a **TextureSampleParameter2D** node inside your graph. In the Details panel, name it exactly AdTexture (or whichever custom name you defined inside your dashboard campaigns!). Connect the node's **RGB** output pins straight to your material's **Base Color** input slot.
Multiply Emissive for Holograms & Dark Screens
For cybercity environments, we highly recommend connecting the parameter to the **Emissive Color** slot as well, multiplied by a scalar parameter (e.g. `EmissiveBoost`). This enables screen visibility under nighttime lighting cycles without requiring expensive game thread dynamic shadow lights!
Dynamic UV Aspect-Ratio Crop (No Stretching!)
To prevent digital billboards from awkwardly squashing or stretching images of different dimensions, our C++ plugin dynamically calculates and injects crop coordinates (UScale, VScale, UOffset, VOffset) directly into the Dynamic Material Instance. Connect them in your base material using the formula: (UV * Scale) + Offset.
- Create a Texture Coordinate (TexCoord) node to get the base UVs.
- Create two Scalar Parameters named UScale and VScale (default value of
1.0). - Join them using an Append Vector node (connect
UScaleto A andVScaleto B). - Create a Multiply node and multiply your TexCoord by the Append output.
- Create two Scalar Parameters named UOffset and VOffset (default value of
0.0). - Join them with another Append Vector node (connect
UOffsetto A andVOffsetto B). - Create an Add node and add the previous multiplication with the output of this second Append.
- Connect the result of the addition directly into the UVs pin of your Texture Sample (AdTexture) node.
UE5 Material Graph Reference
Shader Architecture Guide
Add a **Texture Parameter** named exactly AdTexture.
Connect pin **RGB** directly to the **Base Color** slot of the material M_MatStream_Base.
Multiply pin **A** by scalar **EmissiveBoost** and connect to **Emissive Color**.
Unreal Shaders Starter Kit
Download the pre-compiled asset pack containing ready-to-use material templates to drag-and-drop into your Unreal project.
Unreal Level Alignment Pro-Tips
1. The Red Axis Rule (Orientation)
Always align your actor mesh so that the screen's face points in the **Positive X-Axis** direction (Unreal's red movement arrow). The dot product view telemetry reads the actor's Forward Vector. If your billboard face is rotated sideways or backwards, players looking straight at it will mistakenly report a view coefficient of `0` or `-1`!
2. Aspect Ratio Matching
Avoid stretching standard campaigns. A standard horizontal ad banner is designed at a **728x90** aspect ratio. Ensure you scale your Mesh component proportions in the level editor to match this aspect ratio (e.g. Set scale bounds to `X: 0.1, Y: 8.0, Z: 1.0`) to avoid pixel squash.
**Video & Audio Falloff**: When deploying **Video Streams** with dynamic audio, make sure the mesh has collision block rules enabled. The spatial falloff calculations evaluate attenuation distance based on player camera listeners relative to the mesh collision bounds!
Multi-Element Meshes
A common setup in Unreal is a single Static Mesh with multiple material slots (Element 0, Element 1, Element 2…). By default, MatStream applies the ad texture to Element 0. If your ad material is assigned to a different slot, you must tell the component which one to use.
How to configure it
- Select your Actor in the Unreal Editor Level or Blueprint.
- Click on the MatStreamZone component in the Components panel.
- In the Details panel, find the MatStream | Visual category.
- Set Target Material Index to the Element number of the material slot that contains your ad material (e.g.,
5for Element 5).
; Your mesh has these material slots:
; Element 0 → MI_KitchenSink_01 (base)
; Element 1 → MI_KitchenSink_02
; Element 2 → MI_KitchenSink_02_Glass
; Element 3 → MI_Plaster_01
; Element 4 → MI_Tiles_01
; Element 5 → MI_Edge_Decal ← your ad material lives here
; In MatStreamZone Details → MatStream | Visual:
TargetMaterialIndex = 5Decal Components
MatStream natively supports UDecalComponent in addition to standard Mesh components. Decals are a popular technique for projecting ads onto surfaces like floors, walls, and ceilings without modifying the underlying geometry's materials.
Add a Decal Component to your Actor
In the Blueprint or C++ Actor that will show the ad, add a Decal Component (not a Static Mesh). Assign a Material Instance based on your M_MatStream_Base material to its Decal Material slot.
Name your Decal Component
If you have multiple components on the same Actor, set the Target Component Name field in the MatStreamZone details to the exact name of your Decal Component (e.g., DecalComponent0). If the Actor only has one Decal, leave it empty — MatStream will find it automatically.
Note: Target Material Index is ignored for Decals
Unlike mesh components which can have multiple material slots, a Decal Component has only one Decal Material. The Target Material Index setting is automatically ignored when targeting a Decal.
Material Compatibility
Decal materials must use the Deferred Decal blend mode in the Material Editor. Make sure your M_MatStream_Base material has this mode enabled, and that the AdTexture parameter is wired up exactly as described in the Material & Actor Setup section.
Performance Footprint
Designed for AAA spatial simulations. The plugin operates completely on multi-threaded caching structures, avoiding any game thread locking or garbage collector overhead at runtime.
| Metric Category | Footprint Standard | Pipeline Mechanism |
|---|---|---|
| Tick Overhead | < 0.02ms / frame | Asynchronous tick throttling model |
| Memory Usage | ~4.2 MB Flat | Fixed pool pre-allocations, zero heap fragmentation |
| Network Latency | < 10ms HTTP handshake | Local non-blocking API proxy queuing |
| GPU Pipeline | Dynamic Texture Swap | Multi-threaded DirectX12 / Vulkan descriptor updates |
QR Runtime API
When dynamic ad streams are unavailable, MatStream falls back to local procedural QR generation. The plugin computes the pixel structure natively in C++ inside a single frame and outputs a scannable Dynamic Material Instance texture. To customize fallback destinations or view real-time scan telemetry, you can configure these routing parameters when creating campaigns directly on the Cloud Console.
**No external APIs called**: QR patterns are drawn procedurally in C++ memory using standard mathematical matrices to prevent network vulnerability.
Beyond Gaming
Live Content Infrastructure for Every Unreal Industry
Unreal Engine is the rendering backbone of multiple industries — architecture, film, automotive, simulation, and events. MatStream's core premise applies equally to all of them: any material that renders in a 3D world can be made live, contextual, and remotely updatable.
The Core Abstraction
In gaming, a material zone is called an "Ad Slot." In architecture, it's a "tenant facade." In virtual production, it's a "stage background layer." In automotive, it's a "configurator surface."
They are all the same thing: a material parameter that should change based on external data, without rebuilding the project.MatStream is the infrastructure layer that makes that possible across every vertical.
Virtual Production & Film
LED Volume Stages · The Volume Technology
Hollywood LED volume stages (like those used in The Mandalorian and Avatar) run entirely on Unreal Engine. The stage background is a live rendered Unreal scene projected onto a curved LED wall.
MatStream can stream into that rendered scene in real time — updating brand placements, regional versions of signage, sponsor backgrounds, or language-specific elements between takes without stopping production.
Dynamic Localization
Same scene, different language assets per distribution region
Sponsor Integration
Brand placements streamed live from campaign management
Scene Variants
Multiple background versions without scene duplication
Zero Re-render
Content updates without stopping the Unreal session
Architecture & Real Estate
AEC · Virtual Walkthroughs · Client Presentations
Real estate developers and architecture firms use Unreal for photorealistic client walkthroughs. With MatStream, the same virtual building can show different tenant branding, furniture, artwork, or signage per client session — without maintaining multiple project copies.
// Example: Architecture firm workflow
Zone: "BuildingFacade_L3"
Campaign: "TechCorp Tenant Branding v2"
Trigger: client_id == "techcorp_nyc"
// → Facade updates live during the meeting
Automotive
Virtual showrooms where dealers update pricing, offers, and featured models from a dashboard. Zero Unreal knowledge required.
Events & Concerts
Sponsor content swaps between acts in virtual concerts and live events — without touching the Unreal project session.
Industrial Training
Safety signage, hazard labels, and procedure overlays in virtual factory simulators updated by supervisors in real time.
MatStream Vision
"We are building the Stripe of 3D content delivery — the infrastructure layer that makes any surface in any virtual world updateable from the web, without rebuilding the project."
Gaming is our entry market. The infrastructure we build today scales to every industry using Unreal Engine as a rendering platform.