111 lines
2.7 KiB
JSON
111 lines
2.7 KiB
JSON
{
|
|
"id": "feedback-highlight-accumulator",
|
|
"name": "Feedback Background Memory",
|
|
"description": "Demonstrates writable full-frame shader feedback by learning a persistent per-pixel background model, then comparing the live frame against that learned plate. This cannot be reproduced by only reading ordinary history frames because the shader writes its own evolving state back each frame.",
|
|
"category": "Feedback",
|
|
"entryPoint": "updateBackgroundModel",
|
|
"passes": [
|
|
{
|
|
"id": "background",
|
|
"source": "shader.slang",
|
|
"entryPoint": "updateBackgroundModel",
|
|
"output": "backgroundModel"
|
|
},
|
|
{
|
|
"id": "display",
|
|
"source": "shader.slang",
|
|
"entryPoint": "displayBackgroundDifference",
|
|
"inputs": [
|
|
"backgroundModel"
|
|
],
|
|
"output": "layerOutput"
|
|
}
|
|
],
|
|
"feedback": {
|
|
"enabled": true,
|
|
"writePass": "background"
|
|
},
|
|
"parameters": [
|
|
{
|
|
"id": "learnRate",
|
|
"label": "Learn Rate",
|
|
"type": "float",
|
|
"default": 0.03,
|
|
"min": 0.001,
|
|
"max": 0.5,
|
|
"step": 0.001,
|
|
"description": "How quickly the stored background model adapts toward the current frame."
|
|
},
|
|
{
|
|
"id": "differenceThreshold",
|
|
"label": "Difference Threshold",
|
|
"type": "float",
|
|
"default": 0.12,
|
|
"min": 0.001,
|
|
"max": 1.0,
|
|
"step": 0.001,
|
|
"description": "Minimum difference between the live frame and stored background before the overlay becomes visible."
|
|
},
|
|
{
|
|
"id": "softness",
|
|
"label": "Threshold Softness",
|
|
"type": "float",
|
|
"default": 0.08,
|
|
"min": 0.001,
|
|
"max": 0.5,
|
|
"step": 0.001,
|
|
"description": "Softens the transition around the difference threshold."
|
|
},
|
|
{
|
|
"id": "overlayOpacity",
|
|
"label": "Overlay Opacity",
|
|
"type": "float",
|
|
"default": 0.85,
|
|
"min": 0.0,
|
|
"max": 1.0,
|
|
"step": 0.01,
|
|
"description": "Strength of the motion/difference overlay on top of the live image."
|
|
},
|
|
{
|
|
"id": "backgroundMix",
|
|
"label": "Background Mix",
|
|
"type": "float",
|
|
"default": 0.15,
|
|
"min": 0.0,
|
|
"max": 1.0,
|
|
"step": 0.01,
|
|
"description": "Amount of the learned background model shown underneath the live source."
|
|
},
|
|
{
|
|
"id": "overlayTint",
|
|
"label": "Overlay Tint",
|
|
"type": "color",
|
|
"default": [
|
|
1.0,
|
|
0.45,
|
|
0.08,
|
|
1.0
|
|
],
|
|
"min": [
|
|
0.0,
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"max": [
|
|
1.0,
|
|
1.0,
|
|
1.0,
|
|
1.0
|
|
],
|
|
"step": [
|
|
0.01,
|
|
0.01,
|
|
0.01,
|
|
0.01
|
|
],
|
|
"description": "Tint used for areas that differ from the learned background."
|
|
}
|
|
]
|
|
}
|