diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e6e798..77341fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,8 +261,10 @@ set(VMIX_RSC_FILES ./rsc/images/mask_linear_right.png ./rsc/images/vimix_256x256.png ./rsc/images/icons.dds - ./rsc/images/gradient_0.png - ./rsc/images/gradient_1.png + ./rsc/images/gradient_0_cross_linear.png + ./rsc/images/gradient_1_black_linear.png + ./rsc/images/gradient_2_cross_quad.png + ./rsc/images/gradient_3_black_quad.png ./rsc/images/transparencygrid.png ./rsc/images/shadow.dds ./rsc/images/glow.dds diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index 613db4e..e7d6d71 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -1542,7 +1542,7 @@ void Navigator::RenderTransitionPannel() if (ImGuiToolkit::ButtonIcon(9, 1)) Settings::application.transition.profile = 0; ImGui::SameLine(0, 10); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0IExponent\0"); + ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0"); if ( ImGui::Button( ICON_FA_PLAY " Start", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) { TransitionView *tv = static_cast(Mixer::manager().view(View::TRANSITION)); if (tv) tv->play(); diff --git a/View.cpp b/View.cpp index 5705ff3..9e943f6 100644 --- a/View.cpp +++ b/View.cpp @@ -732,8 +732,10 @@ TransitionView::TransitionView() : View(TRANSITION), transition_source_(nullptr) // Geometry Scene background gradient_ = new Switch; - gradient_->attach(new ImageSurface("images/gradient_0.png")); - gradient_->attach(new ImageSurface("images/gradient_1.png")); + gradient_->attach(new ImageSurface("images/gradient_0_cross_linear.png")); + gradient_->attach(new ImageSurface("images/gradient_1_black_linear.png")); + gradient_->attach(new ImageSurface("images/gradient_2_cross_quad.png")); + gradient_->attach(new ImageSurface("images/gradient_3_black_quad.png")); gradient_->scale_ = glm::vec3(0.501f, 0.006f, 1.f); gradient_->translation_ = glm::vec3(-0.5f, -0.005f, -0.01f); scene.fg()->attach(gradient_); @@ -779,8 +781,16 @@ void TransitionView::update(float dt) // cross fading if ( Settings::application.transition.cross_fade ) { - // change alpha of session: identical coordinates in Mixing View - transition_source_->group(View::MIXING)->translation_.x = CLAMP(d, -1.f, 0.f); + float f = 0.f; + // change alpha of session: + if (Settings::application.transition.profile == 0) + // linear => identical coordinates in Mixing View + f = d; + else { + // quadratic => square coordinates in Mixing View + f = (d+1.f)*(d+1.f) -1.f; + } + transition_source_->group(View::MIXING)->translation_.x = CLAMP(f, -1.f, 0.f); transition_source_->group(View::MIXING)->translation_.y = 0.f; // reset / no fading @@ -794,9 +804,13 @@ void TransitionView::update(float dt) transition_source_->group(View::MIXING)->translation_.y = 0.f; // fade to black at 50% : fade-out [-1.0 -0.5], fade-in [-0.5 0.0] - float f = ABS(2.f * d + 1.f); // linear - // d = ( 2 * d + 1.f); // quadratic - // d *= d; + float f = 0.f; + if (Settings::application.transition.profile == 0) + f = ABS(2.f * d + 1.f); // linear + else { + f = ( 2 * d + 1.f); // quadratic + f *= f; + } Mixer::manager().session()->setFading( 1.f - f ); } @@ -831,7 +845,7 @@ void TransitionView::update(float dt) void TransitionView::draw() { // update the GUI depending on changes in settings - gradient_->setActive( Settings::application.transition.cross_fade ? 0 : 1); + gradient_->setActive( 2*Settings::application.transition.profile + (Settings::application.transition.cross_fade ? 0 : 1) ); // draw scene of this view scene.root()->draw(glm::identity(), Rendering::manager().Projection()); diff --git a/rsc/images/gradient_0.png b/rsc/images/gradient_0.png deleted file mode 100644 index 9a1f2b8..0000000 Binary files a/rsc/images/gradient_0.png and /dev/null differ diff --git a/rsc/images/gradient_0_cross_linear.png b/rsc/images/gradient_0_cross_linear.png new file mode 100644 index 0000000..213c758 Binary files /dev/null and b/rsc/images/gradient_0_cross_linear.png differ diff --git a/rsc/images/gradient_1.png b/rsc/images/gradient_1.png deleted file mode 100644 index 50fdacb..0000000 Binary files a/rsc/images/gradient_1.png and /dev/null differ diff --git a/rsc/images/gradient_1_black_linear.png b/rsc/images/gradient_1_black_linear.png new file mode 100644 index 0000000..88126dd Binary files /dev/null and b/rsc/images/gradient_1_black_linear.png differ diff --git a/rsc/images/gradient_2_cross_quad.png b/rsc/images/gradient_2_cross_quad.png new file mode 100644 index 0000000..af5eed9 Binary files /dev/null and b/rsc/images/gradient_2_cross_quad.png differ diff --git a/rsc/images/gradient_3_black_quad.png b/rsc/images/gradient_3_black_quad.png new file mode 100644 index 0000000..e609937 Binary files /dev/null and b/rsc/images/gradient_3_black_quad.png differ diff --git a/rsc/images/transparencygrid.png b/rsc/images/transparencygrid.png index 62a9ec8..0424cc9 100644 Binary files a/rsc/images/transparencygrid.png and b/rsc/images/transparencygrid.png differ