update timeline layout and frame counter, add 500ms update timer on windows to force redraw, fix animation frames export
This commit is contained in:
@@ -1123,7 +1123,7 @@ void ui::Canvas::export_anim(std::string data_path)
|
||||
|
||||
// prepare common states
|
||||
glViewport(0, 0, m_width, m_height);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RTT m_latlong;
|
||||
m_latlong.create(m_width * 4, m_height * 2); // NOTE: w and h must be equal to make sense
|
||||
@@ -1153,29 +1153,18 @@ void ui::Canvas::export_anim(std::string data_path)
|
||||
ui::ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
|
||||
m_plane.draw_fill();
|
||||
|
||||
// copy to tmp2 for layer blending
|
||||
glActiveTexture(GL_TEXTURE0); // TODO: maybe remove this line
|
||||
m_tex2[i].bind();
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, m_width, m_height);
|
||||
m_tex2[i].unbind();
|
||||
|
||||
m_layers[layer_index].m_rtt[i].bindTexture();
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
m_tex2[i].bind();
|
||||
m_sampler.bind(0);
|
||||
m_sampler_bg.bind(1);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
ShaderManager::use(ui::kShader::TextureAlpha);
|
||||
ShaderManager::u_int(kShaderUniform::TexBG, 1);
|
||||
ShaderManager::u_float(kShaderUniform::Alpha, 1);
|
||||
ShaderManager::u_int(kShaderUniform::Highlight, false);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
|
||||
|
||||
m_sampler_mask.bind(0);
|
||||
m_layers[layer_index].m_rtt[i].bindTexture();
|
||||
m_plane.draw_fill();
|
||||
m_sampler.unbind();
|
||||
m_sampler_bg.unbind();
|
||||
m_tex2[i].unbind();
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
m_layers[layer_index].m_rtt[i].unbindTexture();
|
||||
m_sampler_mask.unbind();
|
||||
|
||||
// copy result to cubemap
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
|
||||
@@ -1183,13 +1172,6 @@ void ui::Canvas::export_anim(std::string data_path)
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
||||
|
||||
m_tmp[i].unbindFramebuffer();
|
||||
|
||||
// m_layers[layer_index].m_rtt[i].bindFramebuffer();
|
||||
// // copy result to cubemap
|
||||
// glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
|
||||
// glCopyTexImage2D(faces[i], 0, GL_RGBA8, 0, 0, m_width, m_height, 0);
|
||||
// glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
||||
// m_layers[layer_index].m_rtt[i].unbindFramebuffer();
|
||||
}
|
||||
|
||||
glViewport(0, 0, m_latlong.getWidth(), m_latlong.getHeight());
|
||||
|
||||
Reference in New Issue
Block a user