test equirect timelapse
This commit is contained in:
14
src/app.cpp
14
src/app.cpp
@@ -623,7 +623,18 @@ void App::draw(float dt)
|
|||||||
|
|
||||||
LOG("rec tick");
|
LOG("rec tick");
|
||||||
rec_timer = 0.f;
|
rec_timer = 0.f;
|
||||||
|
|
||||||
|
Canvas::I->draw_merge(true);
|
||||||
|
Texture2D equirect = Canvas::I->m_layers_merge.gen_equirect({ 1024, 512 });
|
||||||
|
auto img = std::make_unique<Image>(equirect.get_image());
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(rec_mutex);
|
||||||
|
rec_frames.emplace_back(std::move(img));
|
||||||
|
rec_cv.notify_all();
|
||||||
|
}
|
||||||
|
equirect.destroy();
|
||||||
|
|
||||||
|
/*
|
||||||
auto img = std::make_unique<Image>();
|
auto img = std::make_unique<Image>();
|
||||||
img->create(width, height);
|
img->create(width, height);
|
||||||
#if __IOS__
|
#if __IOS__
|
||||||
@@ -644,6 +655,7 @@ void App::draw(float dt)
|
|||||||
rec_frames.emplace_back(std::move(img));
|
rec_frames.emplace_back(std::move(img));
|
||||||
rec_cv.notify_all();
|
rec_cv.notify_all();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
update_rec_frames();
|
update_rec_frames();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -826,7 +838,7 @@ void App::rec_loop()
|
|||||||
if (!m_encoder)
|
if (!m_encoder)
|
||||||
{
|
{
|
||||||
m_encoder = std::make_unique<MP4Encoder>();
|
m_encoder = std::make_unique<MP4Encoder>();
|
||||||
m_encoder->init(512, 512, 30, 500 << 10);
|
m_encoder->init(1024, 512, 30, 500 << 10);
|
||||||
}
|
}
|
||||||
while(rec_running)
|
while(rec_running)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ TextureCube Layer::gen_cube()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture2D Layer::gen_equirect()
|
Texture2D Layer::gen_equirect(glm::ivec2 size /*= { 0, 0 }*/)
|
||||||
{
|
{
|
||||||
Texture2D ret;
|
Texture2D ret;
|
||||||
|
|
||||||
@@ -60,10 +60,13 @@ Texture2D Layer::gen_equirect()
|
|||||||
|
|
||||||
TextureCube cube;
|
TextureCube cube;
|
||||||
RTT latlong;
|
RTT latlong;
|
||||||
|
|
||||||
|
if (size.x == 0 || size.y == 0)
|
||||||
|
size = { w, h };
|
||||||
|
|
||||||
cube = gen_cube();
|
cube = gen_cube();
|
||||||
latlong.create(w * 4, h * 2);
|
latlong.create(size.x * 4, size.y * 2);
|
||||||
ret.create(w * 4, h * 2);
|
ret.create(size.x * 4, size.y * 2);
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
void clear(const glm::vec4& c, int frame = -1);
|
void clear(const glm::vec4& c, int frame = -1);
|
||||||
LayerFrame::Snapshot snapshot(int frame = -1, std::array<glm::vec4, 6>* dirty_box = nullptr, std::array<bool, 6>* dirty_face = nullptr);
|
LayerFrame::Snapshot snapshot(int frame = -1, std::array<glm::vec4, 6>* dirty_box = nullptr, std::array<bool, 6>* dirty_face = nullptr);
|
||||||
TextureCube gen_cube();
|
TextureCube gen_cube();
|
||||||
Texture2D gen_equirect();
|
Texture2D gen_equirect(glm::ivec2 size = { 0, 0 });
|
||||||
void restore(const LayerFrame::Snapshot& snap, int frame = -1);
|
void restore(const LayerFrame::Snapshot& snap, int frame = -1);
|
||||||
void destroy();
|
void destroy();
|
||||||
void optimize(int frame = -1);
|
void optimize(int frame = -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user