- elseif live_signal_num == FADE_SIGNAL_NUM then -- Fade.
- local input0_type = get_input_type(signals, fade_src_signal)
- local input0_scale = needs_scale(signals, fade_src_signal, width, height)
- local input1_type = get_input_type(signals, fade_dst_signal)
- local input1_scale = needs_scale(signals, fade_dst_signal, width, height)
- local chain = fade_chains[input0_type][input0_scale][input1_type][input1_scale][true]
- prepare = function()
- if input0_type == "live" or input0_type == "livedeint" then
- chain.input0.input:connect_signal(fade_src_signal)
- set_neutral_color_from_signal(chain.input0.wb_effect, fade_src_signal)
- end
- set_scale_parameters_if_needed(chain.input0, width, height)
- if input1_type == "live" or input1_type == "livedeint" then
- chain.input1.input:connect_signal(fade_dst_signal)
- set_neutral_color_from_signal(chain.input1.wb_effect, fade_dst_signal)
- end
- set_scale_parameters_if_needed(chain.input1, width, height)
- local tt = calc_fade_progress(t, transition_start, transition_end)
-
- chain.mix_effect:set_float("strength_first", 1.0 - tt)
- chain.mix_effect:set_float("strength_second", tt)
- end
- return chain.chain, prepare
- end
-
- -- SBS code (live_signal_num == SBS_SIGNAL_NUM).
- local input0_type = get_input_type(signals, INPUT0_SIGNAL_NUM)
- local input1_type = get_input_type(signals, INPUT1_SIGNAL_NUM)
- if t > transition_end and zoom_dst == 1.0 then
- -- Special case: Show only the single image on screen.
- local input0_scale = needs_scale(signals, fade_src_signal, width, height)
- local chain = simple_chains[input0_type][input0_scale][true]
- prepare = function()
- chain.input:connect_signal(INPUT0_SIGNAL_NUM)
- set_scale_parameters_if_needed(chain, width, height)
- set_neutral_color(chain.wb_effect, neutral_colors[1])
- end
- return chain.chain, prepare
- end
- local chain = sbs_chains[input0_type][input1_type][true]
- prepare = function()
- if t < transition_start then
- prepare_sbs_chain(chain, zoom_src, width, height, input_resolution)
- elseif t > transition_end then
- prepare_sbs_chain(chain, zoom_dst, width, height, input_resolution)
- else
- local tt = (t - transition_start) / (transition_end - transition_start)
- -- Smooth it a bit.
- tt = math.sin(tt * 3.14159265358 * 0.5)
- prepare_sbs_chain(chain, zoom_src + (zoom_dst - zoom_src) * tt, width, height, input_resolution)
- end