X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=diffusion_effect.cpp;h=f07f9d14eaa4cb1e4b32bb7f8323f47ed107c165;hp=4e996b83ed999693ea37119375d3d01811ffcc8e;hb=e655afd53f2e56938bd4e7f72640eff56ef4a1ee;hpb=34121ba75f6274c25c2cee53169819ae96e77d66 diff --git a/diffusion_effect.cpp b/diffusion_effect.cpp index 4e996b8..f07f9d1 100644 --- a/diffusion_effect.cpp +++ b/diffusion_effect.cpp @@ -12,19 +12,19 @@ DiffusionEffect::DiffusionEffect() { } -std::string DiffusionEffect::output_fragment_shader() +void DiffusionEffect::rewrite_graph(EffectChain *graph, Node *self) { - return read_file("sandbox_effect.frag"); -} + assert(self->incoming_links.size() == 1); + Node *input = self->incoming_links[0]; -void DiffusionEffect::add_self_to_effect_chain(EffectChain *chain, const std::vector &inputs) { - assert(inputs.size() == 1); - blur->add_self_to_effect_chain(chain, inputs); + Node *blur_node = graph->add_node(blur); + Node *overlay_matte_node = graph->add_node(overlay_matte); + graph->replace_receiver(self, overlay_matte_node); + graph->connect_nodes(input, blur_node); + graph->connect_nodes(blur_node, overlay_matte_node); + graph->replace_sender(self, overlay_matte_node); - std::vector overlay_matte_inputs; - overlay_matte_inputs.push_back(inputs[0]); - overlay_matte_inputs.push_back(chain->last_added_effect()); // FIXME - overlay_matte->add_self_to_effect_chain(chain, overlay_matte_inputs); + self->disabled = true; } bool DiffusionEffect::set_float(const std::string &key, float value) {