parse abr from PS 2018, restore xmp injection, check uniform hash collision

This commit is contained in:
2019-02-25 23:23:14 +01:00
parent 87044e06c4
commit d3768f43c9
11 changed files with 93 additions and 28 deletions

View File

@@ -278,9 +278,9 @@ void NodeStrokePreview::draw_stroke()
}
{
float w = m_size.x;
float h = m_size.y;
float pad = m_size.x * .15f;
float w = m_size.x * App::I.zoom;
float h = m_size.y * App::I.zoom;
float pad = m_size.x * App::I.zoom * .15f;
std::vector<glm::vec2> kp = { { pad, pad },{ pad, h - pad },{ w - pad, pad },{ w - pad, h - pad } };
for (int i = 0; i < 20; i++)
{
@@ -326,7 +326,8 @@ void NodeStrokePreview::draw_stroke()
ShaderManager::u_float(kShaderUniform::Wet, 0);
ShaderManager::u_float(kShaderUniform::Noise, 0);
glActiveTexture(GL_TEXTURE0);
dual_brush->m_tip_texture->bind();
if (dual_brush->m_tip_texture)
dual_brush->m_tip_texture->bind();
auto frames_dual = stroke_draw_compute(m_dual_stroke);
for (auto& f : frames_dual)
{
@@ -335,8 +336,6 @@ void NodeStrokePreview::draw_stroke()
ShaderManager::u_float(kShaderUniform::Opacity, f.opacity);
auto rect = stroke_draw_samples(f.shapes, m_tex_dual);
}
glActiveTexture(GL_TEXTURE0);
dual_brush->m_tip_texture->unbind();
// copy raw stroke to tex
glActiveTexture(GL_TEXTURE1);