remove direct use of rtt and dirty area from the layer

This commit is contained in:
2019-10-15 11:57:39 +02:00
parent 9e93fe48d6
commit 9ccd6ed2f4
12 changed files with 404 additions and 334 deletions

View File

@@ -211,7 +211,7 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
if (!(canvas->m_canvas->m_show_tmp && canvas->m_canvas->m_current_layer_idx == layer_index) &&
(!canvas->m_canvas->m_layers[layer_index]->m_visible ||
canvas->m_canvas->m_layers[layer_index]->m_opacity == .0f ||
!canvas->m_canvas->m_layers[layer_index]->m_dirty_face[plane_index]))
!canvas->m_canvas->m_layers[layer_index]->face(plane_index)))
continue;
int z = (int)(canvas->m_canvas->m_layers.size() - i);
@@ -236,17 +236,17 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
ShaderManager::u_int(kShaderUniform::Mask, canvas->m_canvas->m_smask_active);
ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp_z);
glActiveTexture(GL_TEXTURE0);
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].bindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).bindTexture();
glActiveTexture(GL_TEXTURE1);
canvas->m_canvas->m_tmp[plane_index].bindTexture();
glActiveTexture(GL_TEXTURE2);
canvas->m_canvas->m_smask.m_rtt[plane_index].bindTexture();
canvas->m_canvas->m_smask.rtt(plane_index).bindTexture();
m_face_plane.draw_fill();
canvas->m_canvas->m_smask.m_rtt[plane_index].unbindTexture();
canvas->m_canvas->m_smask.rtt(plane_index).unbindTexture();
glActiveTexture(GL_TEXTURE1);
canvas->m_canvas->m_tmp[plane_index].unbindTexture();
glActiveTexture(GL_TEXTURE0);
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].unbindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).unbindTexture();
}
else if (canvas->m_canvas->m_show_tmp && canvas->m_canvas->m_current_layer_idx == layer_index)
{
@@ -287,11 +287,11 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
ShaderManager::u_vec2(kShaderUniform::PatternOffset, Canvas::I->m_pattern_offset);
glActiveTexture(GL_TEXTURE0);
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].bindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).bindTexture();
glActiveTexture(GL_TEXTURE1);
canvas->m_canvas->m_tmp[plane_index].bindTexture();
glActiveTexture(GL_TEXTURE2);
canvas->m_canvas->m_smask.m_rtt[plane_index].bindTexture();
canvas->m_canvas->m_smask.rtt(plane_index).bindTexture();
glActiveTexture(GL_TEXTURE3);
if (b->m_dual_enabled)
canvas->m_canvas->m_tmp_dual[plane_index].bindTexture();
@@ -304,11 +304,11 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
if (b->m_dual_enabled)
canvas->m_canvas->m_tmp_dual[plane_index].unbindTexture();
glActiveTexture(GL_TEXTURE2);
canvas->m_canvas->m_smask.m_rtt[plane_index].unbindTexture();
canvas->m_canvas->m_smask.rtt(plane_index).unbindTexture();
glActiveTexture(GL_TEXTURE1);
canvas->m_canvas->m_tmp[plane_index].unbindTexture();
glActiveTexture(GL_TEXTURE0);
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].unbindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).unbindTexture();
}
else
{
@@ -320,9 +320,9 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp_z);
glActiveTexture(GL_TEXTURE0);
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].bindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).bindTexture();
m_face_plane.draw_fill();
canvas->m_canvas->m_layers[layer_index]->m_rtt[plane_index].unbindTexture();
canvas->m_canvas->m_layers[layer_index]->rtt(plane_index).unbindTexture();
}
}
}