add color dodge and multiply blending modes shaders, change tmp framebuffer to RGBA32F for better precision and fix the blending problem for the stroke not reaching full opacity

This commit is contained in:
2017-11-11 16:54:21 +00:00
parent 71f18cb292
commit fa4e67617b
4 changed files with 17 additions and 14 deletions

View File

@@ -40,7 +40,7 @@ void RTT::destroy()
// h = 0;
}
bool RTT::create(int width, int height, int tex/* = -1*/)
bool RTT::create(int width, int height, int tex/* = -1*/, GLint internal_format)
{
// Destroy any previously created object
destroy();
@@ -60,7 +60,7 @@ bool RTT::create(int width, int height, int tex/* = -1*/)
glBindTexture(GL_TEXTURE_2D, texID);
if (tex == -1)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);