Update README.md
This commit is contained in:
60
README.md
60
README.md
@@ -321,3 +321,63 @@ If `SLANG_ROOT` or `MSDF_ATLAS_GEN_ROOT` is not set, the workflow falls back to
|
|||||||
- add spout input/output (https://github.com/leadedge/Spout2)
|
- add spout input/output (https://github.com/leadedge/Spout2)
|
||||||
- Add Aja input and output (Assuming i can get a hold of an aja card)
|
- Add Aja input and output (Assuming i can get a hold of an aja card)
|
||||||
- Add bluefish input and output (Assuming again card acess)
|
- Add bluefish input and output (Assuming again card acess)
|
||||||
|
- Endpoint to show OSC paths seperatly instead of a part of the control UI
|
||||||
|
|
||||||
|
|
||||||
|
## Custom shader UI
|
||||||
|
Extend the shader manifest contract
|
||||||
|
Add optional UI metadata:
|
||||||
|
|
||||||
|
"ui": {
|
||||||
|
"type": "webComponent",
|
||||||
|
"entry": "ui/controls.js",
|
||||||
|
"tag": "my-shader-controls"
|
||||||
|
}
|
||||||
|
Keep this optional. No custom UI means current default controls.
|
||||||
|
|
||||||
|
Expose UI metadata in /api/state
|
||||||
|
Add the parsed ui block to each shader/layer summary so the React app knows whether a layer has a custom control panel.
|
||||||
|
|
||||||
|
Serve shader package UI assets safely
|
||||||
|
Add a route like:
|
||||||
|
|
||||||
|
/shader-assets/{shaderId}/ui/controls.js
|
||||||
|
It should only serve files inside that shader package folder.
|
||||||
|
|
||||||
|
Add a React host component
|
||||||
|
Create something like ShaderCustomPanel.jsx that:
|
||||||
|
|
||||||
|
dynamically imports/registers the custom element
|
||||||
|
passes layer, parameters, and setParameter
|
||||||
|
catches load/render failures
|
||||||
|
falls back to the normal ParameterField grid
|
||||||
|
Define the custom element API
|
||||||
|
Keep it small and stable:
|
||||||
|
|
||||||
|
element.layer = layer;
|
||||||
|
element.parameters = layer.parameters;
|
||||||
|
element.setParameter = (id, value) => {};
|
||||||
|
element.requestReset = () => {};
|
||||||
|
Custom UI should never bypass manifest validation.
|
||||||
|
|
||||||
|
Add fallback and escape hatch
|
||||||
|
Even if custom UI loads, provide a “Default controls” toggle per layer. That is the life raft.
|
||||||
|
|
||||||
|
Add tests
|
||||||
|
Backend:
|
||||||
|
|
||||||
|
manifest parser accepts valid UI blocks
|
||||||
|
rejects unsafe paths like ../
|
||||||
|
/api/state includes UI metadata
|
||||||
|
asset route refuses files outside the shader package
|
||||||
|
Frontend:
|
||||||
|
|
||||||
|
falls back when custom component fails
|
||||||
|
calls /api/layers/update-parameter through the same path as default controls
|
||||||
|
Document the contract
|
||||||
|
Add a section to shaders/SHADER_CONTRACT.md with:
|
||||||
|
|
||||||
|
manifest example
|
||||||
|
custom element lifecycle
|
||||||
|
available properties/functions
|
||||||
|
rule: all controls must map to declared parameters
|
||||||
Reference in New Issue
Block a user