fix opacity jitter
This commit is contained in:
@@ -100,11 +100,11 @@ void main()
|
||||
fg.rgb = mix(fg.rgb, mbg.rgb, mix_alpha * mbg.a);
|
||||
}
|
||||
|
||||
mediump float contribution = (opacity - bg.a) * fg.a;
|
||||
mediump float contribution = max(0.0, opacity - bg.a) * fg.a;
|
||||
mediump float alpha_tot = bg.a + contribution;
|
||||
mediump vec3 rgb = mix(bg.rgb, fg.rgb, fg.a / alpha_tot);
|
||||
mediump vec3 rgb = mix(bg.rgb, fg.rgb, clamp(fg.a / alpha_tot, 0.0, 1.0));
|
||||
mediump vec4 frag_wet = vec4(rgb, max(bg.a, fg.a * 1.2));
|
||||
mediump vec4 frag_dry = vec4(rgb, min(alpha_tot, opacity));
|
||||
mediump vec4 frag_dry = vec4(rgb, alpha_tot);
|
||||
frag = mix(frag_dry, frag_wet, wet);
|
||||
}
|
||||
|
||||
|
||||
@@ -330,9 +330,9 @@ bool ShaderManager::load(kShader id, const std::string& path)
|
||||
|
||||
bool ShaderManager::reload()
|
||||
{
|
||||
bool success = true;
|
||||
bool success = false;
|
||||
for (auto& s : m_shaders)
|
||||
success &= s.second.reload();
|
||||
success |= s.second.reload();
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user