add support for high res brush textures, implement mipmaps on brush

This commit is contained in:
2017-09-30 16:35:12 +01:00
parent 763e446cc5
commit 964795b44d
17 changed files with 61 additions and 20 deletions

View File

@@ -226,7 +226,7 @@ void ui::Stroke::add_point(glm::vec2 pos, float pressure)
pressure = pressure * glm::pow(m_curve, 2.f);
if (m_brush.m_tip_size_pressure)
m_step = glm::max(m_brush.m_tip_spacing * m_brush.m_tip_size * 100 * pressure, 1.f);
m_step = glm::max(glm::pow(m_brush.m_tip_spacing * 4.f, 2.f) * glm::pow(m_brush.m_tip_size, 3.f) * 800.f * pressure, 1.f);
float dist = m_keypoints.empty() ? 0.f :
m_keypoints.back().dist + glm::distance(m_keypoints.back().pos, pos);
@@ -244,7 +244,7 @@ void ui::Stroke::start(const ui::Brush& brush)
m_curve_angles.clear();
m_last_kp = 0;
m_dist = 0.f;
m_step = glm::max(brush.m_tip_spacing * brush.m_tip_size * 100, 1.f);
m_brush = brush;
m_step = glm::max(glm::pow(m_brush.m_tip_spacing * 4.f, 2.f) * glm::pow(m_brush.m_tip_size, 3.f) * 800.f, 1.f);
prng.seed(0);
}