ABR tip dynamics (aka jitter)
This commit is contained in:
36
src/abr.cpp
36
src/abr.cpp
@@ -153,6 +153,42 @@ std::vector<std::shared_ptr<Brush>> ABR::compute_brushes(const std::string& path
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p->value<Boolean>("useTipDynamics"))
|
||||||
|
{
|
||||||
|
// other properties 'brushProjection', 'minimumRoundness', 'roundnessDynamics', 'tiltScale'
|
||||||
|
|
||||||
|
auto jitter_size = p->get<Descriptor>("szVr");
|
||||||
|
if (jitter_size)
|
||||||
|
{
|
||||||
|
b->m_jitter_scale = jitter_size->value<UnitFloat>("jitter") * 0.01f;
|
||||||
|
// TODO: p->value<UnitFloat>("minimumDiameter") * 0.001f; // minimum size
|
||||||
|
}
|
||||||
|
|
||||||
|
auto jitter_angle = p->get<Descriptor>("angleDynamics");
|
||||||
|
if (jitter_angle)
|
||||||
|
{
|
||||||
|
auto mode = jitter_angle->value<Integer>("bVTy");
|
||||||
|
if (mode == 0)
|
||||||
|
{
|
||||||
|
b->m_jitter_angle = jitter_angle->value<UnitFloat>("jitter") * 0.01f;
|
||||||
|
}
|
||||||
|
else if (mode == 5)
|
||||||
|
{
|
||||||
|
b->m_jitter_angle = jitter_angle->value<UnitFloat>("jitter") * 0.01f;
|
||||||
|
b->m_tip_angle_follow = true;
|
||||||
|
}
|
||||||
|
else if (mode == 6)
|
||||||
|
{
|
||||||
|
b->m_jitter_angle = jitter_angle->value<UnitFloat>("jitter") * 0.01f;
|
||||||
|
b->m_tip_angle_follow = true; // temporary use full direction
|
||||||
|
// TODO: implement initial direction only
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
b->m_tip_randflipx = p->value<Boolean>("flipX");
|
||||||
|
b->m_tip_randflipy = p->value<Boolean>("flipY");
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> modes = {
|
std::vector<std::string> modes = {
|
||||||
"normal", // normal (not in Photoshop)
|
"normal", // normal (not in Photoshop)
|
||||||
"Mltp", // multiply
|
"Mltp", // multiply
|
||||||
|
|||||||
20
src/app.cpp
20
src/app.cpp
@@ -403,16 +403,16 @@ void App::init()
|
|||||||
LOG("GL vendor: %s", glGetString(GL_VENDOR));
|
LOG("GL vendor: %s", glGetString(GL_VENDOR));
|
||||||
LOG("GL renderer: %s", glGetString(GL_RENDERER));
|
LOG("GL renderer: %s", glGetString(GL_RENDERER));
|
||||||
|
|
||||||
GLint n_exts;
|
//GLint n_exts;
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &n_exts);
|
//glGetIntegerv(GL_NUM_EXTENSIONS, &n_exts);
|
||||||
for (int i = 0; i < n_exts; i++)
|
//for (int i = 0; i < n_exts; i++)
|
||||||
{
|
//{
|
||||||
std::string ext = (const char*)glGetStringi(GL_EXTENSIONS, i);
|
// std::string ext = (const char*)glGetStringi(GL_EXTENSIONS, i);
|
||||||
//if (ext.find("debug") != std::string::npos)
|
// //if (ext.find("debug") != std::string::npos)
|
||||||
{
|
// {
|
||||||
LOG("%s", glGetStringi(GL_EXTENSIONS, i));
|
// LOG("%s", glGetStringi(GL_EXTENSIONS, i));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
LOG("Screen Resolution: %dx%d", (int)width, (int)height);
|
LOG("Screen Resolution: %dx%d", (int)width, (int)height);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user