temporal effects

This commit is contained in:
2026-05-02 19:23:03 +10:00
parent 2a0eea936d
commit 1d9bf151ce
13 changed files with 786 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
{
"id": "temporal-ghost-trail",
"name": "Temporal Ghost Trail",
"description": "Blends older pre-layer input frames into the current layer input for a soft temporal trail.",
"category": "Built-in",
"entryPoint": "shadeVideo",
"temporal": {
"enabled": true,
"historySource": "preLayerInput",
"historyLength": 12
},
"parameters": [
{
"id": "currentMix",
"label": "Current Mix",
"type": "float",
"default": 0.72,
"min": 0.0,
"max": 1.0,
"step": 0.01
},
{
"id": "trailMix",
"label": "Trail Mix",
"type": "float",
"default": 0.28,
"min": 0.0,
"max": 1.0,
"step": 0.01
}
]
}

View File

@@ -0,0 +1,11 @@
float4 shadeVideo(ShaderContext context)
{
float4 history0 = sampleTemporalHistory(1, context.uv);
float4 history1 = sampleTemporalHistory(3, context.uv);
float4 history2 = sampleTemporalHistory(5, context.uv);
float4 trail = history0 * 0.5 + history1 * 0.3 + history2 * 0.2;
float trailAmount = clamp(trailMix, 0.0, 1.0);
float currentAmount = clamp(currentMix, 0.0, 1.0);
float weightSum = max(0.0001, currentAmount + trailAmount);
return saturate((context.sourceColor * currentAmount + trail * trailAmount) / weightSum);
}