Improving rendering of TransitionView

This commit is contained in:
brunoherbelin
2020-07-08 08:52:11 +02:00
parent 09e864bf7c
commit 9320ba6743
10 changed files with 23 additions and 16 deletions

View File

@@ -261,6 +261,8 @@ 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/transparencygrid.png
./rsc/images/shadow.dds
./rsc/images/glow.dds

View File

@@ -72,8 +72,6 @@ protected:
Type type_;
};
class SelectionBox : public Group
{
public:

View File

@@ -106,9 +106,7 @@ void ImageSurface::init()
// load image if specified (should always be the case)
if ( !resource_.empty()) {
float ar = 1.0;
textureindex_ = Resource::getTextureImage(resource_, &ar);
scale_.x = ar;
textureindex_ = Resource::getTextureImage(resource_);
}
}

View File

@@ -613,7 +613,7 @@ void UserInterface::Terminate()
void UserInterface::showMenuOptions()
{
ImGui::MenuItem( ICON_FA_PLAY " Smooth transition", nullptr, &Settings::application.smooth_transition);
ImGui::MenuItem( ICON_FA_ARROW_CIRCLE_RIGHT " Smooth transition", nullptr, &Settings::application.smooth_transition);
ImGui::Separator();
ImGui::MenuItem( ICON_FA_HISTORY " Load most recent on start", nullptr, &Settings::application.recentSessions.load_at_start);
@@ -1241,7 +1241,7 @@ void Navigator::Render()
}
else {
// the "=" icon for menu
if (ImGui::Selectable( ICON_FA_PLAY, &selected_button[NAV_TRANS], 0, iconsize))
if (ImGui::Selectable( ICON_FA_ARROW_CIRCLE_RIGHT, &selected_button[NAV_TRANS], 0, iconsize))
{
// Mixer::manager().unsetCurrentSource();
applyButtonSelection(NAV_TRANS);
@@ -1543,7 +1543,7 @@ void Navigator::RenderTransitionPannel()
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0IExponent\0");
if ( ImGui::Button( ICON_FA_PLAY " Start", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
if ( ImGui::Button( ICON_FA_ARROW_CIRCLE_RIGHT " Start", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
if (tv) tv->play();
}

View File

@@ -727,16 +727,24 @@ TransitionView::TransitionView() : View(TRANSITION), transition_source_(nullptr)
restoreSettings();
// Geometry Scene background
gradient_ = new Switch;
gradient_->attach(new ImageSurface("images/gradient_0.png"));
gradient_->attach(new ImageSurface("images/gradient_1.png"));
gradient_->scale_ = glm::vec3(0.5f, 0.01f, 1.f);
gradient_->translation_ = glm::vec3(-0.5f, -0.007f, -0.01f);
scene.fg()->attach(gradient_);
Mesh *horizontal_line = new Mesh("mesh/h_line.ply");
horizontal_line->shader()->color = glm::vec4( COLOR_TRANSITION_LINES, 0.9f );
scene.fg()->attach(horizontal_line);
mark_half_ = new Mesh("mesh/h_mark.ply");
mark_half_->translation_ = glm::vec3(-0.5f, 0.f, 0.0f);
mark_half_->shader()->color = glm::vec4( COLOR_TRANSITION_LINES, 0.9f );
mark_half_->visible_ = false;
scene.fg()->attach(mark_half_);
// move the whole forground below
mark_ = new Mesh("mesh/h_mark.ply");
mark_->translation_ = glm::vec3(-0.5f, 0.f, 0.0f);
mark_->shader()->color = glm::vec4( COLOR_TRANSITION_LINES, 0.9f );
mark_->visible_ = false;
scene.fg()->attach(mark_);
// move the whole forground below the icons
scene.fg()->translation_ = glm::vec3(0.f, -0.11f, 0.0f);
output_surface_ = new Surface;
@@ -812,7 +820,7 @@ void TransitionView::update(float dt)
void TransitionView::draw()
{
// update the GUI depending on changes in settings
mark_half_->visible_ = !Settings::application.transition.cross_fade;
gradient->setActive( Settings::application.transition.cross_fade ? 0 : 1);
// draw scene of this view
scene.root()->draw(glm::identity<glm::mat4>(), Rendering::manager().Projection());

3
View.h
View File

@@ -167,7 +167,8 @@ public:
private:
class Surface *output_surface_;
class Mesh *mark_half_;
class Mesh *mark_;
Switch *gradient_;
SessionSource *transition_source_;
};

BIN
rsc/images/gradient_0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
rsc/images/gradient_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 5.9 KiB