[graphics] merc2 renderer (#1374)

* tfrag3 data for merc2

* dma hooks for merc2

* start designing merc2 opengl, seems like the simple approach will be the best here

* before bone packing experiment

* fix up bones.gc

* use uniform buffer

* speedup, fix faces and eyes

* final fixes
This commit is contained in:
water111
2022-05-28 19:28:19 -04:00
committed by GitHub
parent 9449078a9b
commit e56b2e8d56
32 changed files with 1639 additions and 317 deletions
+1 -44
View File
@@ -1,7 +1,7 @@
#include <array>
#include "extract_shrub.h"
#include "decompiler/level_extractor/extract_common.h"
#include "decompiler/ObjectFile/LinkedObjectFile.h"
#include "common/util/FileUtil.h"
@@ -395,49 +395,6 @@ std::string dump_full_to_obj(const std::vector<ShrubProtoInfo>& protos) {
return result;
}
u32 clean_up_vertex_indices(std::vector<u32>& idx) {
std::vector<u32> fixed;
u32 num_tris = 0;
bool looking_for_start = true;
size_t i_of_start;
for (size_t i = 0; i < idx.size(); i++) {
if (looking_for_start) {
if (idx[i] != UINT32_MAX) {
looking_for_start = false;
i_of_start = i;
}
} else {
if (idx[i] == UINT32_MAX) {
looking_for_start = true;
size_t num_verts = i - i_of_start;
if (num_verts >= 3) {
if (!fixed.empty()) {
fixed.push_back(UINT32_MAX);
}
fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + i);
num_tris += (num_verts - 2);
}
}
}
}
if (!looking_for_start) {
size_t num_verts = idx.size() - i_of_start;
if (num_verts >= 3) {
if (!fixed.empty()) {
fixed.push_back(UINT32_MAX);
}
fixed.insert(fixed.end(), idx.begin() + i_of_start, idx.begin() + idx.size());
num_tris += (num_verts - 2);
}
}
idx = std::move(fixed);
return num_tris;
}
void make_draws(tfrag3::Level& lev,
tfrag3::ShrubTree& tree_out,
const std::vector<ShrubProtoInfo>& protos,