fix randomized faces on export jpg

This commit is contained in:
2018-12-15 18:10:26 +01:00
parent 9d13087036
commit 4d2706bfab

View File

@@ -1254,7 +1254,7 @@ void Canvas::export_equirectangular_thread(std::string file_path)
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id); glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
for (GLuint i = 0; i < 6; i++) for (GLuint i = 0; i < 6; i++)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA8, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA8, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
int faces[]{ static int faces[]{
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, // front GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, // front
GL_TEXTURE_CUBE_MAP_NEGATIVE_X, // right GL_TEXTURE_CUBE_MAP_NEGATIVE_X, // right
GL_TEXTURE_CUBE_MAP_POSITIVE_Z, // back GL_TEXTURE_CUBE_MAP_POSITIVE_Z, // back
@@ -1268,6 +1268,10 @@ void Canvas::export_equirectangular_thread(std::string file_path)
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
// prepare common states
glViewport(0, 0, m_width, m_height);
glEnable(GL_BLEND);
ShaderManager::use(kShader::TextureAlpha); ShaderManager::use(kShader::TextureAlpha);
ShaderManager::u_int(kShaderUniform::Highlight, false); ShaderManager::u_int(kShaderUniform::Highlight, false);
ShaderManager::u_int(kShaderUniform::Tex, 0); ShaderManager::u_int(kShaderUniform::Tex, 0);