Expand description
.hook shaders (roadmap step 9, docs/design.md#roadmap, docs/hooks.md): mpv user shaders
run in the libplacebo grade pass through pl_mpv_user_shader_parse, as
ffcine_render::Hooks with their //!PARAMs set from the timeline.
- Vendored:
ADAPTIVE_SHARPEN(BSD-2-Clause, header kept), the default sharpen, replacing the generated unsharp hook (ffcine_render::shaders::unsharp), which stays for prototype diffs (Sharpen::Unsharp); ArtCNN’s luma doublers (ARTCNN_C4F16, MIT). - Not vendored (GPL/LGPL): KrigBilateral and FSRCNNX are known by name (
EXTERNAL) and loaded from user-supplied files on the shader path (shader_path). - Timeline:
ffcine.fx.shader/1 {shader, params}withshaderan alias inmetadata.ffcine.project.shaders, a vendored name or a path;paramsconstants or keyframes (shader). - Order:
ordersorts a grade’s hooks by stage, then geometry, sharpen, user shaders and the review overlay within a stage.
Our own filters (denoise, grain) are compute passes in ffcine-filters instead.
Re-exports§
pub use parse::HookInfo;pub use parse::ParamInfo;pub use parse::ParamKind;pub use parse::parse;pub use shader::ShaderEffect;
Modules§
- grade
- A resolved timeline grade (
GradeParams) as a GPUGrade: the grade LUT mixed bylut_strength, the post-LUT look hook,extrafilters as hooks,rgb_gainandsharpen. Shared by timeline shots (ffcine render,looks,still) and comp layers’grade, so the same grade renders the same pixels in both. - parse
- Just enough of the mpv
.hookformat to check a shader before libplacebo sees it: the stages it hooks and its//!PARAMs (name, type, bounds, default). - shader
ffcine.fx.shader/1 {shader, params}: an mpv.hookshader on a clip, its//!PARAMs set from the timeline.
Structs§
- External
- A shader known by name whose licence keeps it out of ffcine (Apache-2.0): the user downloads
filefromurlinto ashader_pathdirectory.
Enums§
- Sharpen
- Which sharpener a
sharpenamount drives.
Constants§
- ADAPTIVE_
SHARPEN - bacondither’s Adaptive-sharpen (mpv port by igv) at
PREOUTPUT, withcurve_heightandovershoot_ctrlas//!PARAMs. Licence: BSD-2-Clause (header in the file). - ARTCNN_
C4F16 - ArtCNN C4F16 (Artoriuz), a CNN luma doubler at
LUMA: runs when the output is more than 1.3x the source on both axes. Licence: MIT (header in the file,shaders/LICENSE-ArtCNN). - ARTCNN_
C4F16_ DS ARTCNN_C4F16trained to also denoise and sharpen.- EXTERNAL
- Shaders loaded by name from the
shader_path, not shipped. - SHARPEN_
HOOK
Functions§
- external
- The
EXTERNALshadername’s path and text, from the first ofdirsholding its file.Noneifnameisn’t external; an error naming the download if no directory has it. - named
- A shader by name, vendored or
EXTERNAL(on theshader_path), as aHooknamed after it.Noneif the name is neither. - order
- Sorts hooks by their first stage (
parse::STAGES), then by role; stable otherwise. libplacebo runs each hook at its own stage regardless, so this only decides the order of hooks sharing a stage, and makes the array read in pipeline order. - retarget_
output - Moves
//!HOOK OUTPUTpasses toPREOUTPUT. mpv runsOUTPUTon RGB; libplacebo runs it after encoding to the target’s colour system, which for ffcine’s YUV outputs is YCbCr, so an RGB shader there would sharpen chroma and tint the picture.PREOUTPUTis the RGB stage mpv shaders expect. - shader_
path - Directories searched for
EXTERNALshaders:FFCINE_SHADER_PATH(:-separated), then$XDG_DATA_HOME/ffcine/shaders(default~/.local/share/ffcine/shaders). - sharpen
- Sets
grade’s sharpening toamount(0 = off) withkind, replacing any earlier one. - vendored
- Vendored shaders by name.