summaryrefslogtreecommitdiff
path: root/indra/llmeshoptimizer
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-23 21:30:13 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-23 21:30:13 +0300
commit9aaac1bb985f5bd65f9b0fe985c47cd30dcfd166 (patch)
treee00990a13bdb33e8e12927667481ad2f61e2cbbc /indra/llmeshoptimizer
parentd5857b376f1da9ad4fe25ced1a4785a40a82a709 (diff)
DRTVWR-542 Attempt to simplify all faces of an object as a whole and split back into faces
Diffstat (limited to 'indra/llmeshoptimizer')
-rw-r--r--indra/llmeshoptimizer/llmeshoptimizer.cpp25
-rw-r--r--indra/llmeshoptimizer/llmeshoptimizer.h13
2 files changed, 37 insertions, 1 deletions
diff --git a/indra/llmeshoptimizer/llmeshoptimizer.cpp b/indra/llmeshoptimizer/llmeshoptimizer.cpp
index 09fa7cb235..8097a05511 100644
--- a/indra/llmeshoptimizer/llmeshoptimizer.cpp
+++ b/indra/llmeshoptimizer/llmeshoptimizer.cpp
@@ -59,6 +59,30 @@ void LLMeshOptimizer::generateShadowIndexBuffer(U16 *destination,
}
//static
+U64 LLMeshOptimizer::simplifyU32(U32 *destination,
+ const U32 *indices,
+ U64 index_count,
+ const LLVector4a *vertex_positions,
+ U64 vertex_count,
+ U64 vertex_positions_stride,
+ U64 target_index_count,
+ F32 target_error,
+ F32* result_error
+)
+{
+ return meshopt_simplify<unsigned int>(destination,
+ indices,
+ index_count,
+ (const float*)vertex_positions,
+ vertex_count,
+ vertex_positions_stride,
+ target_index_count,
+ target_error,
+ result_error
+ );
+}
+
+//static
U64 LLMeshOptimizer::simplify(U16 *destination,
const U16 *indices,
U64 index_count,
@@ -70,7 +94,6 @@ U64 LLMeshOptimizer::simplify(U16 *destination,
F32* result_error
)
{
-
return meshopt_simplify<unsigned short>(destination,
indices,
index_count,
diff --git a/indra/llmeshoptimizer/llmeshoptimizer.h b/indra/llmeshoptimizer/llmeshoptimizer.h
index 1aa02372fa..2696733eb2 100644
--- a/indra/llmeshoptimizer/llmeshoptimizer.h
+++ b/indra/llmeshoptimizer/llmeshoptimizer.h
@@ -46,6 +46,19 @@ public:
// returns amount of indices in destiantion
// result_error returns how far from original the model is in % if not NULL
+ static U64 simplifyU32(
+ U32 *destination,
+ const U32 *indices,
+ U64 index_count,
+ const LLVector4a *vertex_positions,
+ U64 vertex_count,
+ U64 vertex_positions_stride,
+ U64 target_index_count,
+ F32 target_error,
+ F32* result_error);
+
+ // returns amount of indices in destiantion
+ // result_error returns how far from original the model is in % if not NULL
static U64 simplify(
U16 *destination,
const U16 *indices,