fix glsl float interpolation, fix layers on ui reload, add vr thread for Quest
This commit is contained in:
@@ -834,12 +834,14 @@ void Canvas::stroke_commit()
|
||||
ShaderManager::u_vec2(kShaderUniform::Resolution, m_size);
|
||||
ShaderManager::u_float(kShaderUniform::Alpha, 1);
|
||||
ShaderManager::u_int(kShaderUniform::Mask, m_smask_active);
|
||||
ShaderManager::u_int(kShaderUniform::Lock, false);
|
||||
ShaderManager::u_int(kShaderUniform::UseFragcoord, false);
|
||||
ShaderManager::u_int(kShaderUniform::BlendMode, b->m_blend_mode);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
|
||||
ShaderManager::u_int(kShaderUniform::UseDual, b->m_dual_enabled);
|
||||
ShaderManager::u_int(kShaderUniform::UsePattern, b->m_pattern_enabled && !b->m_pattern_eachsample);
|
||||
ShaderManager::u_int(kShaderUniform::DualBlendMode, b->m_dual_blend_mode);
|
||||
ShaderManager::u_float(kShaderUniform::DualAlpha, b->m_dual_opacity);
|
||||
ShaderManager::u_int(kShaderUniform::UsePattern, b->m_pattern_enabled && !b->m_pattern_eachsample);
|
||||
ShaderManager::u_vec2(kShaderUniform::PatternScale, patt_scale);
|
||||
ShaderManager::u_float(kShaderUniform::PatternInvert, b->m_pattern_invert);
|
||||
ShaderManager::u_float(kShaderUniform::PatternBright, b->m_pattern_brightness);
|
||||
@@ -847,7 +849,6 @@ void Canvas::stroke_commit()
|
||||
ShaderManager::u_float(kShaderUniform::PatternDepth, b->m_pattern_depth);
|
||||
ShaderManager::u_int(kShaderUniform::PatternBlendMode, b->m_pattern_blend_mode);
|
||||
ShaderManager::u_vec2(kShaderUniform::PatternOffset, m_pattern_offset);
|
||||
ShaderManager::u_float(kShaderUniform::DualAlpha, b->m_dual_opacity);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
m_tex2[i].bind();
|
||||
@@ -1494,24 +1495,22 @@ void Canvas::resize(int width, int height)
|
||||
m_size = { width, height };
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (ShaderManager::ext_texture_float)
|
||||
if (ShaderManager::ext_float32_linear)
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA32F);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA32F);
|
||||
m_tex[i].create(width, height, GL_RGBA32F);
|
||||
}
|
||||
else if (ShaderManager::ext_half_float_pixel)
|
||||
else if (ShaderManager::ext_float16)
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA16F);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA16F);
|
||||
m_tex[i].create(width, height, GL_RGBA16F);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA8);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA8);
|
||||
m_tex[i].create(width, height, GL_RGBA8);
|
||||
}
|
||||
m_tex[i].create(width, height, GL_RGBA8);
|
||||
m_tex2[i].create(width, height, GL_RGBA8);
|
||||
}
|
||||
for (auto& l : m_layers)
|
||||
@@ -1548,24 +1547,22 @@ bool Canvas::create(int width, int height)
|
||||
m_size = { width, height };
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (ShaderManager::ext_texture_float)
|
||||
if (ShaderManager::ext_float32_linear)
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA32F);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA32F);
|
||||
m_tex[i].create(width, height, GL_RGBA32F);
|
||||
}
|
||||
else if (ShaderManager::ext_half_float_pixel)
|
||||
else if (ShaderManager::ext_float16)
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA16F);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA16F);
|
||||
m_tex[i].create(width, height, GL_RGBA16F);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tmp[i].create(width, height, -1, GL_RGBA8);
|
||||
m_tmp_dual[i].create(width, height, -1, GL_RGBA8);
|
||||
m_tex[i].create(width, height, GL_RGBA8);
|
||||
}
|
||||
m_tex[i].create(width, height, GL_RGBA8);
|
||||
m_tex2[i].create(width, height, GL_RGBA8);
|
||||
}
|
||||
#if defined(__IOS__) || defined(__ANDROID__)
|
||||
|
||||
Reference in New Issue
Block a user