完成
This commit is contained in:
@@ -572,7 +572,7 @@ void TextureLoading::build_command_buffers()
|
||||
|
||||
|
||||
|
||||
draw_point_cloud(draw_cmd_buffers[i]);
|
||||
//draw_point_cloud(draw_cmd_buffers[i]);
|
||||
//draw_point_cloud_line(draw_cmd_buffers[i]);
|
||||
|
||||
|
||||
@@ -582,7 +582,11 @@ void TextureLoading::build_command_buffers()
|
||||
VkDeviceSize offsets[1] = { 0 };
|
||||
vkCmdBindVertexBuffers(draw_cmd_buffers[i], 0, 1, vertex_buffer->get(), offsets);
|
||||
vkCmdBindIndexBuffer(draw_cmd_buffers[i], index_buffer->get_handle(), 0, VK_INDEX_TYPE_UINT32);
|
||||
vkCmdDrawIndexed(draw_cmd_buffers[i], index_count, 1, 0, 0, 0);
|
||||
|
||||
if (getCurrentTimeMillis() - last_update_time < 1000)
|
||||
{
|
||||
vkCmdDrawIndexed(draw_cmd_buffers[i], index_count, 1, 0, 0, 0);
|
||||
}
|
||||
|
||||
//draw_ui(draw_cmd_buffers[i]);
|
||||
|
||||
@@ -692,7 +696,7 @@ bool TextureLoading::LoadOBJ(const std::string& filename,
|
||||
float u, v;
|
||||
iss >> u >> v;
|
||||
temp_texcoords.push_back(u);
|
||||
temp_texcoords.push_back(v);
|
||||
temp_texcoords.push_back(1-v);
|
||||
}
|
||||
else if (type == "vn") { // 法线
|
||||
float nx, ny, nz;
|
||||
@@ -1659,6 +1663,8 @@ bool TextureLoading::prepare(const vkb::ApplicationOptions& options)
|
||||
return false;
|
||||
}
|
||||
|
||||
last_update_time = getCurrentTimeMillis();
|
||||
|
||||
myFloatValue = 1.5f;
|
||||
|
||||
// --- 加载前景纹理 (示例) ---
|
||||
@@ -1692,9 +1698,9 @@ bool TextureLoading::prepare(const vkb::ApplicationOptions& options)
|
||||
dataSize = lineImage.size();
|
||||
processWithVulkan(lineImage.data(), width, height, rowStride, dataSize, texture_point_line);
|
||||
#ifdef _WIN32
|
||||
const char* filename_test = "assets/test_trans.png";
|
||||
const char* filename_test = "assets/DemoHeadBaseColor.png";
|
||||
#else
|
||||
const char* filename_test = "/sdcard/Android/data/com.khronos.vulkan_samples/files/assets/test_trans.png";
|
||||
const char* filename_test = "/sdcard/Android/data/com.khronos.vulkan_samples/files/assets/DemoHeadBaseColor.png";
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
@@ -1844,7 +1850,7 @@ void ReceiveFacePoint(float* pos, int pointCount, int width, int height)
|
||||
// }
|
||||
//}
|
||||
//debug_str += "]";
|
||||
|
||||
|
||||
TextureLoading* self = TextureLoading::Get();
|
||||
if (self != nullptr)
|
||||
{
|
||||
@@ -1923,6 +1929,8 @@ void TextureLoading::extendPoint(float* pos, int start_id, int end_id, float rat
|
||||
|
||||
void TextureLoading::update_face_vertex_buffer(float* pos, int pointCount)
|
||||
{
|
||||
last_update_time = getCurrentTimeMillis();
|
||||
|
||||
extendPoint(pos, 68, 54);
|
||||
extendPoint(pos, 104, 103);
|
||||
extendPoint(pos, 69, 67);
|
||||
|
||||
Reference in New Issue
Block a user