fix equirectangular shader for higher precision, add polygon draw mode

This commit is contained in:
2017-05-09 08:47:20 +01:00
parent 2e8c0d0865
commit 6548ac3748
11 changed files with 278 additions and 52 deletions

View File

@@ -9,6 +9,7 @@ std::vector<CanvasMode*> ui::Canvas::modes[] = {
{ new CanvasModeLine, new CanvasModeBasicCamera },
{ new CanvasModeCamera, new CanvasModeBasicCamera },
{ new CanvasModeNormal, new CanvasModeBasicCamera },
{ new CanvasModeFill, new CanvasModeBasicCamera },
};
glm::vec3 ui::Canvas::m_plane_origin[6] = {
{ 0, 0,-1}, // front
@@ -564,10 +565,11 @@ void ui::Canvas::save(std::string data_path)
// static char name[128];
// sprintf(name, "%s/Face%d.png", data_path.c_str(), i);
// LOG("writing %s", name);
// //int ret = stbi_write_png(name, m_tmp[i].getWidth(), m_tmp[i].getHeight(), 4, data.get(), m_tmp[i].stride());
// int ret = stbi_write_png(name, m_tmp[i].getWidth(), m_tmp[i].getHeight(), 4, data.get(), m_tmp[i].stride());
// }
glViewport(0, 0, m_latlong.getWidth(), m_latlong.getHeight());
glActiveTexture(GL_TEXTURE0);
m_latlong.bindFramebuffer();
ui::ShaderManager::use(kShader::Equirect);
ui::ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));