Merge branch 'DRTVWR-542-meshopt' of https://bitbucket.org/lindenlab/viewer
commit
d2e5a9b1fe
150
autobuild.xml
150
autobuild.xml
|
|
@ -1289,100 +1289,6 @@
|
|||
<key>version</key>
|
||||
<string>0.0.0</string>
|
||||
</map>
|
||||
<key>glod</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
<string>Copyright 2003 Jonathan Cohen, Nat Duca, David Luebke, Brenden Schubert - Johns Hopkins University and University of Virginia</string>
|
||||
<key>license</key>
|
||||
<string>GLOD Open-Source License Version 1.0</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/GLOD.txt</string>
|
||||
<key>name</key>
|
||||
<string>glod</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>darwin</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>94fc457c46e1fb94b31251bd4747d10f</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.171101143-darwin64-171101143.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
</map>
|
||||
<key>darwin64</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>94fc457c46e1fb94b31251bd4747d10f</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.171101143-darwin64-171101143.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
</map>
|
||||
<key>linux</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>3bae1e9a188680a81c1d5b32571538b9</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.180990859-linux-180990859.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
</map>
|
||||
<key>linux64</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>acc1181cd31ef32c3724eda84ae4b580</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.180990827-linux64-180990827.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
</map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e1f8da12a2b7a6c31830b4bb86d31ed6</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.vs2017-1906061512-windows-vs2017-1906061512.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
<key>windows64</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e906cf08bfbfbd9d4fc78557e021e7d0</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/glod-1.0pre3.vs2017-1906061512-windows64-vs2017-1906061512.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>1.0pre3.532346</string>
|
||||
</map>
|
||||
<key>googlemock</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
|
|
@ -2522,6 +2428,62 @@
|
|||
<key>version</key>
|
||||
<string>7.11.1.297294</string>
|
||||
</map>
|
||||
<key>meshoptimizer</key>
|
||||
<map>
|
||||
<key>canonical_repo</key>
|
||||
<string>https://bitbucket.org/lindenlab/3p-meshoptimizer</string>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (c) 2016-2021 Arseny Kapoulkine</string>
|
||||
<key>description</key>
|
||||
<string>Meshoptimizer. Mesh optimization library.</string>
|
||||
<key>license</key>
|
||||
<string>meshoptimizer</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/meshoptimizer.txt</string>
|
||||
<key>name</key>
|
||||
<string>meshoptimizer</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>darwin64</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>30bc37db57bbd87c4b5f62634964242a</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/84218/784918/meshoptimizer-0.16.561408-darwin64-561408.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
</map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ca3684bcf0447746cd2844e94f6d1fc7</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/84219/784924/meshoptimizer-0.16.561408-windows-561408.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
<key>windows64</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>aef28c089d20f69d13c9c3e113fb3895</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/84220/784931/meshoptimizer-0.16.561408-windows64-561408.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>0.16.561408</string>
|
||||
</map>
|
||||
<key>nghttp2</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ set(cmake_SOURCE_FILES
|
|||
FreeType.cmake
|
||||
GLEXT.cmake
|
||||
GLH.cmake
|
||||
GLOD.cmake
|
||||
## GStreamer010Plugin.cmake
|
||||
GoogleMock.cmake
|
||||
Growl.cmake
|
||||
|
|
@ -62,6 +61,7 @@ set(cmake_SOURCE_FILES
|
|||
LLKDU.cmake
|
||||
LLLogin.cmake
|
||||
LLMath.cmake
|
||||
LLMeshOptimizer.cmake
|
||||
LLMessage.cmake
|
||||
LLPhysicsExtensions.cmake
|
||||
LLPlugin.cmake
|
||||
|
|
@ -75,6 +75,7 @@ set(cmake_SOURCE_FILES
|
|||
LLXML.cmake
|
||||
Linking.cmake
|
||||
MediaPluginBase.cmake
|
||||
MESHOPTIMIZER.cmake
|
||||
NDOF.cmake
|
||||
OPENAL.cmake
|
||||
OpenGL.cmake
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ if(WINDOWS)
|
|||
libaprutil-1.dll
|
||||
libapriconv-1.dll
|
||||
nghttp2.dll
|
||||
glod.dll
|
||||
libhunspell.dll
|
||||
uriparser.dll
|
||||
)
|
||||
|
|
@ -198,7 +197,6 @@ elseif(DARWIN)
|
|||
libaprutil-1.0.dylib
|
||||
libaprutil-1.dylib
|
||||
${EXPAT_COPY}
|
||||
libGLOD.dylib
|
||||
libhunspell-1.3.0.dylib
|
||||
libndofdev.dylib
|
||||
libnghttp2.dylib
|
||||
|
|
@ -252,7 +250,6 @@ elseif(LINUX)
|
|||
${EXPAT_COPY}
|
||||
#libfreetype.so.6.6.2
|
||||
#libfreetype.so.6
|
||||
#libGLOD.so
|
||||
libgmodule-2.0.so
|
||||
libgobject-2.0.so
|
||||
libhunspell-1.3.so.0.0.0
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
#if (USESYSTEMLIBS)
|
||||
# set(GLOD_FIND_REQUIRED true)
|
||||
# include(FindGLOD)
|
||||
#else (USESYSTEMLIBS)
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(glod)
|
||||
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
|
||||
if(LINUX)
|
||||
set(GLOD_LIBRARIES GLOD vds)
|
||||
else()
|
||||
set(GLOD_LIBRARIES GLOD)
|
||||
endif()
|
||||
#endif (USESYSTEMLIBS)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
set(LLMESHOPTIMIZER_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llmeshoptimizer
|
||||
)
|
||||
|
||||
set(LLMESHOPTIMIZER_LIBRARIES llmeshoptimizer)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
use_prebuilt_binary(meshoptimizer)
|
||||
|
||||
if (WINDOWS)
|
||||
set(MESHOPTIMIZER_LIBRARIES meshoptimizer.lib)
|
||||
elseif (LINUX)
|
||||
set(MESHOPTIMIZER_LIBRARIES meshoptimizer.o)
|
||||
elseif (DARWIN)
|
||||
set(MESHOPTIMIZER_LIBRARIES libmeshoptimizer.a)
|
||||
endif (WINDOWS)
|
||||
|
||||
set(MESHOPTIMIZER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/meshoptimizer)
|
||||
|
|
@ -6420,9 +6420,9 @@ void LLVolumeFace::resizeVertices(S32 num_verts)
|
|||
if (num_verts)
|
||||
{
|
||||
//pad texture coordinate block end to allow for QWORD reads
|
||||
S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
|
||||
S32 tc_size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
|
||||
|
||||
mPositions = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
|
||||
mPositions = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+tc_size);
|
||||
mNormals = mPositions+num_verts;
|
||||
mTexCoords = (LLVector2*) (mNormals+num_verts);
|
||||
|
||||
|
|
|
|||
|
|
@ -939,17 +939,23 @@ public:
|
|||
LLVector4a* mCenter;
|
||||
LLVector2 mTexCoordExtents[2]; //minimum and maximum of texture coordinates of the face.
|
||||
|
||||
S32 mNumVertices;
|
||||
S32 mNumVertices; // num vertices == num normals == num texcoords
|
||||
S32 mNumAllocatedVertices;
|
||||
S32 mNumIndices;
|
||||
|
||||
LLVector4a* mPositions;
|
||||
LLVector4a* mNormals;
|
||||
LLVector4a* mPositions; // Contains vertices, nortmals and texcoords
|
||||
LLVector4a* mNormals; // pointer into mPositions
|
||||
LLVector4a* mTangents;
|
||||
LLVector2* mTexCoords;
|
||||
LLVector2* mTexCoords; // pointer into mPositions
|
||||
|
||||
// mIndices contains mNumIndices amount of elements.
|
||||
// It contains triangles, each 3 indices describe one triangle.
|
||||
// If mIndices contains {0, 2, 3, 1, 2, 4}, it means there
|
||||
// are two triangles {0, 2, 3} and {1, 2, 4} with values being
|
||||
// indexes for mPositions/mNormals/mTexCoords
|
||||
U16* mIndices;
|
||||
|
||||
//vertex buffer filled in by LLFace to cache this volume face geometry in vram
|
||||
// vertex buffer filled in by LLFace to cache this volume face geometry in vram
|
||||
// (declared as a LLPointer to LLRefCount to avoid dependency on LLVertexBuffer)
|
||||
mutable LLPointer<LLRefCount> mVertexBuffer;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
project(llmeshoptimizer)
|
||||
|
||||
include(MESHOPTIMIZER)
|
||||
|
||||
include(00-Common)
|
||||
include(LLCommon)
|
||||
include(LLMath)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLMESHOPTIMIZER_INCLUDE_DIR}
|
||||
${MESHOPTIMIZER_INCLUDE_DIRS}
|
||||
${LIBS_PREBUILT_DIR}/include #access to boost headers, needed for LLError
|
||||
)
|
||||
|
||||
set(llmeshoptimizer_SOURCE_FILES
|
||||
llmeshoptimizer.cpp
|
||||
)
|
||||
|
||||
set(llmeshoptimizer_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
llmeshoptimizer.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${llmeshoptimizer_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND llmeshoptimizer_SOURCE_FILES ${llmeshoptimizer_HEADER_FILES})
|
||||
|
||||
#if (USE_MESHOPT)
|
||||
add_library (llmeshoptimizer ${llmeshoptimizer_SOURCE_FILES})
|
||||
|
||||
target_link_libraries(llmeshoptimizer
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${MESHOPTIMIZER_LIBRARIES})
|
||||
|
||||
# Add tests
|
||||
|
||||
#endif (USE_MESHOPT)
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/**
|
||||
* @file llmeshoptimizer.cpp
|
||||
* @brief Wrapper around meshoptimizer
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llmeshoptimizer.h"
|
||||
|
||||
#include "meshoptimizer.h"
|
||||
|
||||
LLMeshOptimizer::LLMeshOptimizer()
|
||||
{
|
||||
// Todo: Looks like for memory management, we can add allocator and deallocator callbacks
|
||||
// Should be one time
|
||||
// meshopt_setAllocator(allocate, deallocate);
|
||||
}
|
||||
|
||||
LLMeshOptimizer::~LLMeshOptimizer()
|
||||
{
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMeshOptimizer::generateShadowIndexBuffer(U16 *destination,
|
||||
const U16 *indices,
|
||||
U64 index_count,
|
||||
const LLVector4a *vertex_positions,
|
||||
U64 vertex_count,
|
||||
U64 vertex_positions_stride
|
||||
)
|
||||
{
|
||||
meshopt_generateShadowIndexBuffer<unsigned short>(destination,
|
||||
indices,
|
||||
index_count,
|
||||
(const float*)vertex_positions, // verify that it is correct to convert to float
|
||||
vertex_count,
|
||||
sizeof(LLVector4a),
|
||||
vertex_positions_stride
|
||||
);
|
||||
}
|
||||
|
||||
//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,
|
||||
bool sloppy,
|
||||
F32* result_error
|
||||
)
|
||||
{
|
||||
if (sloppy)
|
||||
{
|
||||
return meshopt_simplifySloppy<unsigned int>(destination,
|
||||
indices,
|
||||
index_count,
|
||||
(const float*)vertex_positions,
|
||||
vertex_count,
|
||||
vertex_positions_stride,
|
||||
target_index_count,
|
||||
target_error,
|
||||
result_error
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
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,
|
||||
const LLVector4a *vertex_positions,
|
||||
U64 vertex_count,
|
||||
U64 vertex_positions_stride,
|
||||
U64 target_index_count,
|
||||
F32 target_error,
|
||||
bool sloppy,
|
||||
F32* result_error
|
||||
)
|
||||
{
|
||||
if (sloppy)
|
||||
{
|
||||
return meshopt_simplifySloppy<unsigned short>(destination,
|
||||
indices,
|
||||
index_count,
|
||||
(const float*)vertex_positions,
|
||||
vertex_count,
|
||||
vertex_positions_stride,
|
||||
target_index_count,
|
||||
target_error,
|
||||
result_error
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return meshopt_simplify<unsigned short>(destination,
|
||||
indices,
|
||||
index_count,
|
||||
(const float*)vertex_positions,
|
||||
vertex_count,
|
||||
vertex_positions_stride,
|
||||
target_index_count,
|
||||
target_error,
|
||||
result_error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* @file llmeshoptimizer.h
|
||||
* @brief Wrapper around meshoptimizer
|
||||
*
|
||||
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2021, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
#ifndef LLMESHOPTIMIZER_H
|
||||
#define LLMESHOPTIMIZER_H
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmath.h"
|
||||
|
||||
class LLMeshOptimizer
|
||||
{
|
||||
public:
|
||||
LLMeshOptimizer();
|
||||
~LLMeshOptimizer();
|
||||
|
||||
static void generateShadowIndexBuffer(
|
||||
U16 *destination,
|
||||
const U16 *indices,
|
||||
U64 index_count,
|
||||
const LLVector4a *vertex_positions,
|
||||
U64 vertex_count,
|
||||
U64 vertex_positions_stride);
|
||||
|
||||
// returns amount of indices in destiantion
|
||||
// sloppy engages a variant of a mechanizm that does not respect topology as much
|
||||
// but is much more efective for simpler models
|
||||
// result_error returns how far from original the model is in % if not NULL
|
||||
// Works with U32 indices (LLFace uses U16 indices)
|
||||
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,
|
||||
bool sloppy,
|
||||
F32* result_error);
|
||||
|
||||
// Returns amount of indices in destiantion
|
||||
// sloppy engages a variant of a mechanizm that does not respect topology as much
|
||||
// but is much better for simpler models
|
||||
// result_error returns how far from original the model is in % if not NULL
|
||||
// Meant for U16 indices (LLFace uses U16 indices)
|
||||
static U64 simplify(
|
||||
U16 *destination,
|
||||
const U16 *indices,
|
||||
U64 index_count,
|
||||
const LLVector4a *vertex_positions,
|
||||
U64 vertex_count,
|
||||
U64 vertex_positions_stride,
|
||||
U64 target_index_count,
|
||||
F32 target_error,
|
||||
bool sloppy,
|
||||
F32* result_error);
|
||||
private:
|
||||
};
|
||||
|
||||
#endif //LLMESHOPTIMIZER_H
|
||||
|
|
@ -193,7 +193,11 @@ bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S
|
|||
return true;
|
||||
}
|
||||
|
||||
LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& face_list, std::vector<std::string>& materials, domTrianglesRef& tri)
|
||||
LLModel::EModelStatus load_face_from_dom_triangles(
|
||||
std::vector<LLVolumeFace>& face_list,
|
||||
std::vector<std::string>& materials,
|
||||
domTrianglesRef& tri,
|
||||
LLSD& log_msg)
|
||||
{
|
||||
LLVolumeFace face;
|
||||
std::vector<LLVolumeFace::VertexData> verts;
|
||||
|
|
@ -213,12 +217,18 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
|
||||
if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source))
|
||||
{
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorBadElement";
|
||||
log_msg.append(args);
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
if (!pos_source || !pos_source->getFloat_array())
|
||||
{
|
||||
LL_WARNS() << "Unable to process mesh without position data; invalid model; invalid model." << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorPositionInvalidModel";
|
||||
log_msg.append(args);
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -387,7 +397,11 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
return LLModel::NO_ERRORS ;
|
||||
}
|
||||
|
||||
LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& face_list, std::vector<std::string>& materials, domPolylistRef& poly, LLSD& log_msg)
|
||||
LLModel::EModelStatus load_face_from_dom_polylist(
|
||||
std::vector<LLVolumeFace>& face_list,
|
||||
std::vector<std::string>& materials,
|
||||
domPolylistRef& poly,
|
||||
LLSD& log_msg)
|
||||
{
|
||||
domPRef p = poly->getP();
|
||||
domListOfUInts& idx = p->getValue();
|
||||
|
|
@ -414,6 +428,10 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
|
||||
if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source))
|
||||
{
|
||||
LL_WARNS() << "Bad element." << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorBadElement";
|
||||
log_msg.append(args);
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -465,6 +483,9 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
if (!cv.getPosition().isFinite3())
|
||||
{
|
||||
LL_WARNS() << "Found NaN while loading position data from DAE-Model, invalid model." << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "PositionNaN";
|
||||
log_msg.append(args);
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -497,6 +518,10 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
if (!cv.getNormal().isFinite3())
|
||||
{
|
||||
LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "NormalsNaN";
|
||||
log_msg.append(args);
|
||||
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -814,6 +839,9 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
}
|
||||
}
|
||||
|
||||
// Viewer can only fit U16 vertices, shouldn't we do some checks here and return overflow if result has more?
|
||||
llassert(vert_idx.size() < U16_MAX);
|
||||
|
||||
//build vertex array from map
|
||||
std::vector<LLVolumeFace::VertexData> new_verts;
|
||||
new_verts.resize(vert_idx.size());
|
||||
|
|
@ -831,7 +859,12 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
for (U32 i = 0; i < verts.size(); ++i)
|
||||
{
|
||||
indices[i] = vert_idx[verts[i]];
|
||||
llassert(!i || (indices[i-1] != indices[i]));
|
||||
if (i % 3 != 0) // assumes GL_TRIANGLES, compare 0-1, 1-2, 3-4, 4-5 but not 2-3 or 5-6
|
||||
{
|
||||
// A faulty degenerate triangle detection (triangle with 0 area),
|
||||
// probably should be a warning and not an assert
|
||||
llassert(!i || (indices[i-1] != indices[i]));
|
||||
}
|
||||
}
|
||||
|
||||
// DEBUG just build an expanded triangle list
|
||||
|
|
@ -954,6 +987,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
if (!dom)
|
||||
{
|
||||
LL_INFOS() <<" Error with dae - traditionally indicates a corrupt file."<<LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorCorrupt";
|
||||
mWarningsArray.append(args);
|
||||
setLoadState( ERROR_PARSING );
|
||||
return false;
|
||||
}
|
||||
|
|
@ -981,6 +1017,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
if (!doc)
|
||||
{
|
||||
LL_WARNS() << "can't find internal doc" << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorNoDoc";
|
||||
mWarningsArray.append(args);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -988,6 +1027,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
if (!root)
|
||||
{
|
||||
LL_WARNS() << "document has no root" << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorNoRoot";
|
||||
mWarningsArray.append(args);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1003,6 +1045,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
if (!result)
|
||||
{
|
||||
LL_INFOS() << "Could not verify controller" << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorBadElement";
|
||||
mWarningsArray.append(args);
|
||||
setLoadState( ERROR_PARSING );
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1136,6 +1181,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
if (!scene)
|
||||
{
|
||||
LL_WARNS() << "document has no visual_scene" << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorNoScene";
|
||||
mWarningsArray.append(args);
|
||||
setLoadState( ERROR_PARSING );
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1144,11 +1192,14 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
|
||||
bool badElement = false;
|
||||
|
||||
processElement( scene, badElement, &dae );
|
||||
processElement( scene, badElement, &dae);
|
||||
|
||||
if ( badElement )
|
||||
{
|
||||
LL_INFOS()<<"Scene could not be parsed"<<LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "ParsingErrorCantParseScene";
|
||||
mWarningsArray.append(args);
|
||||
setLoadState( ERROR_PARSING );
|
||||
}
|
||||
|
||||
|
|
@ -2003,7 +2054,7 @@ daeElement* LLDAELoader::getChildFromElement( daeElement* pElement, std::string
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* dae )
|
||||
void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* dae)
|
||||
{
|
||||
LLMatrix4 saved_transform;
|
||||
bool pushed_mat = false;
|
||||
|
|
@ -2097,6 +2148,11 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
if (mTransform.determinant() < 0)
|
||||
{ //negative scales are not supported
|
||||
LL_INFOS() << "Negative scale detected, unsupported transform. domInstance_geometry: " << getElementLabel(instance_geo) << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "NegativeScaleTrans";
|
||||
args["LABEL"] = getElementLabel(instance_geo);
|
||||
mWarningsArray.append(args);
|
||||
|
||||
badElement = true;
|
||||
}
|
||||
|
||||
|
|
@ -2120,6 +2176,10 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
if (transformation.determinant() < 0)
|
||||
{ //negative scales are not supported
|
||||
LL_INFOS() << "Negative scale detected, unsupported post-normalization transform. domInstance_geometry: " << getElementLabel(instance_geo) << LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "NegativeScaleNormTrans";
|
||||
args["LABEL"] = getElementLabel(instance_geo);
|
||||
mWarningsArray.append(args);
|
||||
badElement = true;
|
||||
}
|
||||
|
||||
|
|
@ -2161,6 +2221,9 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
else
|
||||
{
|
||||
LL_INFOS()<<"Unable to resolve geometry URL."<<LL_ENDL;
|
||||
LLSD args;
|
||||
args["Message"] = "CantResolveGeometryUrl";
|
||||
mWarningsArray.append(args);
|
||||
badElement = true;
|
||||
}
|
||||
|
||||
|
|
@ -2454,7 +2517,7 @@ bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh, LLSD&
|
|||
{
|
||||
domTrianglesRef& tri = tris.get(i);
|
||||
|
||||
status = load_face_from_dom_triangles(pModel->getVolumeFaces(), pModel->getMaterialList(), tri);
|
||||
status = load_face_from_dom_triangles(pModel->getVolumeFaces(), pModel->getMaterialList(), tri, log_msg);
|
||||
pModel->mStatus = status;
|
||||
if(status != LLModel::NO_ERRORS)
|
||||
{
|
||||
|
|
@ -2481,6 +2544,7 @@ bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh, LLSD&
|
|||
for (U32 i = 0; i < polygons.getCount(); ++i)
|
||||
{
|
||||
domPolygonsRef& poly = polygons.get(i);
|
||||
|
||||
status = load_face_from_dom_polygons(pModel->getVolumeFaces(), pModel->getMaterialList(), poly);
|
||||
|
||||
if(status != LLModel::NO_ERRORS)
|
||||
|
|
|
|||
|
|
@ -287,6 +287,8 @@ public:
|
|||
|
||||
EModelStatus mStatus ;
|
||||
|
||||
// A model/object can only have 8 faces, spillover faces will
|
||||
// be moved to new model/object and assigned a submodel id.
|
||||
int mSubmodelID;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ include(DBusGlib)
|
|||
include(DragDrop)
|
||||
include(EXPAT)
|
||||
include(FMODSTUDIO)
|
||||
include(GLOD)
|
||||
include(Hunspell)
|
||||
include(JsonCpp)
|
||||
include(LLAppearance)
|
||||
|
|
@ -31,6 +30,7 @@ include(LLInventory)
|
|||
include(LLKDU)
|
||||
include(LLLogin)
|
||||
include(LLMath)
|
||||
include(LLMeshOptimizer)
|
||||
include(LLMessage)
|
||||
include(LLPhysicsExtensions)
|
||||
include(LLPlugin)
|
||||
|
|
@ -78,7 +78,6 @@ endif(FMODSTUDIO)
|
|||
include_directories(
|
||||
${DBUSGLIB_INCLUDE_DIRS}
|
||||
${JSONCPP_INCLUDE_DIR}
|
||||
${GLOD_INCLUDE_DIR}
|
||||
${LLAUDIO_INCLUDE_DIRS}
|
||||
${LLCHARACTER_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
|
|
@ -88,6 +87,7 @@ include_directories(
|
|||
${LLKDU_INCLUDE_DIRS}
|
||||
${LLINVENTORY_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLMESHOPTIMIZER_INCLUDE_DIRS}
|
||||
${LLMESSAGE_INCLUDE_DIRS}
|
||||
${LLPLUGIN_INCLUDE_DIRS}
|
||||
${LLPRIMITIVE_INCLUDE_DIRS}
|
||||
|
|
@ -2260,9 +2260,6 @@ if (WINDOWS)
|
|||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapriconv-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Release/glod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/glod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/glod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll
|
||||
|
|
@ -2491,6 +2488,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${LLCHARACTER_LIBRARIES}
|
||||
${LLIMAGE_LIBRARIES}
|
||||
${LLINVENTORY_LIBRARIES}
|
||||
${LLMESHOPTIMIZER_LIBRARIES}
|
||||
${LLMESSAGE_LIBRARIES}
|
||||
${LLPLUGIN_LIBRARIES}
|
||||
${LLPRIMITIVE_LIBRARIES}
|
||||
|
|
@ -2517,7 +2515,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${OPENGL_LIBRARIES}
|
||||
${FMODWRAPPER_LIBRARY} # must come after LLAudio
|
||||
${OPENAL_LIBRARIES}
|
||||
${GLOD_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${JSONCPP_LIBRARIES}
|
||||
${SDL_LIBRARY}
|
||||
|
|
|
|||
|
|
@ -693,3 +693,29 @@ From Vivox:
|
|||
Attn: customer support
|
||||
40 Speen Street Suite 402
|
||||
Framingham, MA 01701
|
||||
|
||||
|
||||
=============
|
||||
meshoptimizer
|
||||
=============
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2021 Arseny Kapoulkine
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
|
|||
|
|
@ -770,71 +770,29 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
=============
|
||||
GLOD license
|
||||
meshoptimizer
|
||||
=============
|
||||
The GLOD Open-Source License Version 1.0 June 16, 2004
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns
|
||||
Hopkins University and David Luebke, Brenden Schubert, University of
|
||||
Virginia. All rights reserved.
|
||||
Copyright (c) 2016-2021 Arseny Kapoulkine
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, is permitted provided that the following conditions are
|
||||
met:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer and
|
||||
request.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer and
|
||||
request in the documentation and/or other materials provided with
|
||||
the distribution.
|
||||
|
||||
3. The name "GLOD" must not be used to endorse or promote products
|
||||
derived from this software without prior written permission.
|
||||
|
||||
4. Redistributions of any modified version of this source, whether in
|
||||
source or binary form , must include a form of the following
|
||||
acknowledgment: "This product is derived from the GLOD library,
|
||||
which is available from http://www.cs.jhu.edu/~graphics/GLOD."
|
||||
|
||||
5. Redistributions of any modified version of this source in binary
|
||||
form must provide, free of charge, access to the modified version
|
||||
of the code.
|
||||
|
||||
6. This license shall be governed by and construed and enforced in
|
||||
accordance with the laws of the State of Maryland, without
|
||||
reference to its conflicts of law provisions. The exclusive
|
||||
jurisdiction and venue for all legal actions relating to this
|
||||
license shall be in courts of competent subject matter jurisdiction
|
||||
located in the State of Maryland.
|
||||
|
||||
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, GLOD IS PROVIDED
|
||||
UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND,
|
||||
EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
|
||||
THAT GLOD IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
|
||||
PURPOSE OR NON-INFRINGING. ALL WARRANTIES ARE DISCLAIMED AND THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE CODE IS WITH
|
||||
YOU. SHOULD ANY CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
|
||||
COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
|
||||
CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY CODE IS
|
||||
AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
|
||||
THE COPYRIGHT HOLDER OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY
|
||||
SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES FOR LOSS OF
|
||||
PROFITS, REVENUE, OR FOR LOSS OF INFORMATION OR ANY OTHER LOSS.
|
||||
|
||||
YOU EXPRESSLY AGREE TO FOREVER INDEMNIFY, DEFEND AND HOLD HARMLESS THE
|
||||
COPYRIGHT HOLDERS AND CONTRIBUTORS OF GLOD AGAINST ALL CLAIMS,
|
||||
DEMANDS, SUITS OR OTHER ACTIONS ARISING DIRECTLY OR INDIRECTLY FROM
|
||||
YOUR ACCEPTANCE AND USE OF GLOD.
|
||||
|
||||
Although NOT REQUIRED, we would appreciate it if active users of GLOD
|
||||
put a link on their web site to the GLOD web site when possible.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@ mAvatarTabIndex(0)
|
|||
mStatusLock = new LLMutex();
|
||||
mModelPreview = NULL;
|
||||
|
||||
mLODMode[LLModel::LOD_HIGH] = 0;
|
||||
mLODMode[LLModel::LOD_HIGH] = LLModelPreview::LOD_FROM_FILE;
|
||||
for (U32 i = 0; i < LLModel::LOD_HIGH; i++)
|
||||
{
|
||||
mLODMode[i] = 1;
|
||||
mLODMode[i] = LLModelPreview::MESH_OPTIMIZER_AUTO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -790,7 +790,20 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
|
|||
|
||||
void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
|
||||
{
|
||||
mModelPreview->onLODParamCommit(lod, enforce_tri_limit);
|
||||
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
|
||||
S32 mode = lod_source_combo->getCurrentIndex();
|
||||
switch (mode)
|
||||
{
|
||||
case LLModelPreview::MESH_OPTIMIZER_AUTO:
|
||||
case LLModelPreview::MESH_OPTIMIZER:
|
||||
case LLModelPreview::MESH_OPTIMIZER_SLOPPY:
|
||||
case LLModelPreview::MESH_OPTIMIZER_COMBINE:
|
||||
mModelPreview->onLODMeshOptimizerParamCommit(lod, enforce_tri_limit, mode);
|
||||
break;
|
||||
default:
|
||||
LL_ERRS() << "Only supposed to be called to generate models" << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
|
||||
//refresh LoDs that reference this one
|
||||
for (S32 i = lod - 1; i >= 0; --i)
|
||||
|
|
@ -1837,7 +1850,11 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
|
|||
refresh();
|
||||
|
||||
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
|
||||
if (lod_source_combo->getCurrentIndex() == LLModelPreview::GENERATE)
|
||||
S32 index = lod_source_combo->getCurrentIndex();
|
||||
if (index == LLModelPreview::MESH_OPTIMIZER_AUTO
|
||||
|| index == LLModelPreview::MESH_OPTIMIZER
|
||||
|| index == LLModelPreview::MESH_OPTIMIZER_SLOPPY
|
||||
|| index == LLModelPreview::MESH_OPTIMIZER_COMBINE)
|
||||
{ //rebuild LoD to update triangle counts
|
||||
onLODParamCommit(lod, true);
|
||||
}
|
||||
|
|
@ -1868,7 +1885,7 @@ void LLFloaterModelPreview::resetUploadOptions()
|
|||
getChild<LLComboBox>("lod_source_" + lod_name[NUM_LOD - 1])->setCurrentByIndex(LLModelPreview::LOD_FROM_FILE);
|
||||
for (S32 lod = 0; lod < NUM_LOD - 1; ++lod)
|
||||
{
|
||||
getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::GENERATE);
|
||||
getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::MESH_OPTIMIZER_AUTO);
|
||||
childSetValue("lod_file_" + lod_name[lod], "");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,9 +196,7 @@ protected:
|
|||
std::map<std::string, bool> mViewOptionDisabled;
|
||||
|
||||
//store which lod mode each LOD is using
|
||||
// 0 - load from file
|
||||
// 1 - auto generate
|
||||
// 2 - use LoD above
|
||||
// See eLoDMode
|
||||
S32 mLODMode[4];
|
||||
|
||||
LLMutex* mStatusLock;
|
||||
|
|
|
|||
|
|
@ -730,13 +730,19 @@ void LLKeyConflictHandler::resetToDefault(const std::string &control_name, U32 i
|
|||
{
|
||||
return;
|
||||
}
|
||||
LLKeyConflict &type_data = mControlsMap[control_name];
|
||||
if (!type_data.mAssignable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLKeyData data = getDefaultControl(control_name, index);
|
||||
|
||||
if (data != mControlsMap[control_name].getKeyData(index))
|
||||
if (data != type_data.getKeyData(index))
|
||||
{
|
||||
// reset controls that might have been switched to our current control
|
||||
removeConflicts(data, mControlsMap[control_name].mConflictMask);
|
||||
mControlsMap[control_name].setKeyData(data, index);
|
||||
mHasUnsavedChanges = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -124,10 +124,19 @@ public:
|
|||
typedef enum
|
||||
{
|
||||
LOD_FROM_FILE = 0,
|
||||
GENERATE,
|
||||
MESH_OPTIMIZER_AUTO, // automatically selects method based on model or face
|
||||
MESH_OPTIMIZER_COMBINE,
|
||||
MESH_OPTIMIZER,
|
||||
MESH_OPTIMIZER_SLOPPY,
|
||||
USE_LOD_ABOVE,
|
||||
} eLoDMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LIMIT_TRIANGLES = 0,
|
||||
LIMIT_ERROR_TRESHOLD,
|
||||
} eLoDLimit;
|
||||
|
||||
public:
|
||||
// Todo: model preview shouldn't need floater dependency, it
|
||||
// should just expose data to floater, not control flaoter like it does
|
||||
|
|
@ -156,7 +165,7 @@ public:
|
|||
void loadModelCallback(S32 lod);
|
||||
bool lodsReady() { return !mGenLOD && mLodsQuery.empty(); }
|
||||
void queryLODs() { mGenLOD = true; };
|
||||
void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
|
||||
void genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 decimation = 3, bool enforce_tri_limit = false);
|
||||
void generateNormals();
|
||||
void restoreNormals();
|
||||
U32 calcResourceCost();
|
||||
|
|
@ -166,8 +175,7 @@ public:
|
|||
void clearIncompatible(S32 lod);
|
||||
void updateStatusMessages();
|
||||
void updateLodControls(S32 lod);
|
||||
void clearGLODGroup();
|
||||
void onLODParamCommit(S32 lod, bool enforce_tri_limit);
|
||||
void onLODMeshOptimizerParamCommit(S32 lod, bool enforce_tri_limit, S32 mode);
|
||||
void addEmptyFace(LLModel* pTarget);
|
||||
|
||||
const bool getModelPivot(void) const { return mHasPivot; }
|
||||
|
|
@ -219,6 +227,10 @@ private:
|
|||
// Count amount of original models, excluding sub-models
|
||||
static U32 countRootModels(LLModelLoader::model_list models);
|
||||
|
||||
// functions for meshoptimizer, return reached simplification ratio
|
||||
F32 genMeshOptimizerPerModel(LLModel *base_model, LLModel *target_model, F32 indices_ratio, F32 error_threshold, bool sloppy);
|
||||
F32 genMeshOptimizerPerFace(LLModel *base_model, LLModel *target_model, U32 face_idx, F32 indices_ratio, F32 error_threshold, bool sloppy);
|
||||
|
||||
protected:
|
||||
friend class LLModelLoader;
|
||||
friend class LLFloaterModelPreview;
|
||||
|
|
@ -251,19 +263,11 @@ protected:
|
|||
|
||||
std::map<std::string, bool> mViewOption;
|
||||
|
||||
//GLOD object parameters (must rebuild object if these change)
|
||||
// Model generation parameters (must rebuild object if these change)
|
||||
bool mLODFrozen;
|
||||
F32 mBuildShareTolerance;
|
||||
U32 mBuildQueueMode;
|
||||
U32 mBuildOperator;
|
||||
U32 mBuildBorderMode;
|
||||
U32 mRequestedLoDMode[LLModel::NUM_LODS];
|
||||
S32 mRequestedTriangleCount[LLModel::NUM_LODS];
|
||||
F32 mRequestedErrorThreshold[LLModel::NUM_LODS];
|
||||
U32 mRequestedBuildOperator[LLModel::NUM_LODS];
|
||||
U32 mRequestedQueueMode[LLModel::NUM_LODS];
|
||||
U32 mRequestedBorderMode[LLModel::NUM_LODS];
|
||||
F32 mRequestedShareTolerance[LLModel::NUM_LODS];
|
||||
F32 mRequestedCreaseAngle[LLModel::NUM_LODS];
|
||||
|
||||
LLModelLoader* mModelLoader;
|
||||
|
|
@ -282,8 +286,14 @@ protected:
|
|||
|
||||
U32 mGroup;
|
||||
std::map<LLPointer<LLModel>, U32> mObject;
|
||||
|
||||
// Amount of triangles in original(base) model
|
||||
U32 mMaxTriangleLimit;
|
||||
|
||||
// Minimum amount of allowed triangles in lod for spin cntrl.
|
||||
// Leave at least one triangle per model.
|
||||
S32 mMinTriangleLimit;
|
||||
|
||||
LLMeshUploadThread::instance_list mUploadData;
|
||||
std::set<LLViewerFetchedTexture * > mTextureSet;
|
||||
|
||||
|
|
|
|||
|
|
@ -248,11 +248,11 @@ expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
|
|||
FMOD Sound System, Copyright (C) Firelight Technologies Pty, Ltd., 1994-2020
|
||||
FreeType Copyright (C) 1996-2002, 2006 David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
GL Copyright (C) 1999-2004 Brian Paul.
|
||||
GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
|
||||
Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
|
||||
HACD Copyright (C) 2011, Khaled Mamou (kmamou@gmail.com)
|
||||
jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
|
||||
jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
meshoptimizer Copyright (c) 2016-2021 Arseny Kapoulkine
|
||||
ogg/vorbis Copyright (C) 2002, Xiphophorus
|
||||
OpenSSL Copyright (C) 1998-2008 The OpenSSL Project.
|
||||
PCRE Copyright (c) 1997-2012 University of Cambridge
|
||||
|
|
|
|||
|
|
@ -49,7 +49,21 @@
|
|||
<string name="UnrecognizedJoint">Rigged to unrecognized joint name [NAME]</string>
|
||||
<string name="UnknownJoints">Skinning disabled due to [COUNT] unknown joints</string>
|
||||
<string name="ModelLoaded">Model [MODEL_NAME] loaded</string>
|
||||
|
||||
<string name="IncompleteTC">Texture coordinates data is not complete.</string>
|
||||
<string name="PositionNaN">Found NaN while loading position data from DAE-Model, invalid model.</string>
|
||||
<string name="NormalsNaN">Found NaN while loading normals from DAE-Model, invalid model.</string>
|
||||
<string name="NegativeScaleTrans">Negative scale detected, unsupported transform. domInstance_geometry: [LABEL]</string>
|
||||
<string name="NegativeScaleNormTrans">Negative scale detected, unsupported post-normalization transform. domInstance_geometry: [LABEL]</string>
|
||||
<string name="CantResolveGeometryUrl">Unable to resolve geometry URL.</string>
|
||||
<string name="ParsingErrorBadElement">Bad element</string>
|
||||
<string name="ParsingErrorCantParseScene">Scene could not be parsed</string>
|
||||
<string name="ParsingErrorCorrupt">Error with dae - traditionally indicates a corrupt file.</string>
|
||||
<string name="ParsingErrorNoController">Could not verify controller</string>
|
||||
<string name="ParsingErrorNoDoc">Can't find internal doc</string>
|
||||
<string name="ParsingErrorNoRoot">Document has no root</string>
|
||||
<string name="ParsingErrorNoScene">Document has no visual_scene</string>
|
||||
<string name="ParsingErrorPositionInvalidModel">Unable to process mesh without position data. Invalid model.</string>
|
||||
|
||||
<panel
|
||||
follows="top|left"
|
||||
|
|
@ -177,9 +191,21 @@
|
|||
label="Load from file"
|
||||
value="Load from file" />
|
||||
<item
|
||||
name="Generate"
|
||||
label="Generate"
|
||||
value="Generate" />
|
||||
name="MeshOpt Auto"
|
||||
label="Generate Auto"
|
||||
value="MeshOpt Auto" />
|
||||
<item
|
||||
name="MeshOptCombine"
|
||||
label="Generate Precise"
|
||||
value="MeshOptCombine" />
|
||||
<item
|
||||
name="MeshOpt"
|
||||
label="Generate per face"
|
||||
value="MeshOpt" />
|
||||
<item
|
||||
name="MeshOptSloppy"
|
||||
label="Generate Sloppy"
|
||||
value="MeshOptSloppy" />
|
||||
</combo_box>
|
||||
<line_editor
|
||||
follows="left|top"
|
||||
|
|
@ -306,9 +332,21 @@
|
|||
label="Load from file"
|
||||
value="Load from file" />
|
||||
<item
|
||||
name="Generate"
|
||||
label="Generate"
|
||||
value="Generate" />
|
||||
name="MeshOpt Auto"
|
||||
label="Generate Auto"
|
||||
value="MeshOpt Auto" />
|
||||
<item
|
||||
name="MeshOptCombine"
|
||||
label="Generate Precise"
|
||||
value="MeshOptCombine" />
|
||||
<item
|
||||
name="MeshOpt"
|
||||
label="Generate per face"
|
||||
value="MeshOpt" />
|
||||
<item
|
||||
name="MeshOptSloppy"
|
||||
label="Generate Sloppy"
|
||||
value="MeshOptSloppy" />
|
||||
<item
|
||||
name="Use LoD above"
|
||||
label="Use LoD above"
|
||||
|
|
@ -439,9 +477,21 @@
|
|||
label="Load from file"
|
||||
value="Load from file" />
|
||||
<item
|
||||
name="Generate"
|
||||
label="Generate"
|
||||
value="Generate" />
|
||||
name="MeshOpt Auto"
|
||||
label="Generate Auto"
|
||||
value="MeshOpt Auto" />
|
||||
<item
|
||||
name="MeshOptCombine"
|
||||
label="Generate Precise"
|
||||
value="MeshOptCombine" />
|
||||
<item
|
||||
name="MeshOpt"
|
||||
label="Generate per face"
|
||||
value="MeshOpt" />
|
||||
<item
|
||||
name="MeshOptSloppy"
|
||||
label="Generate Sloppy"
|
||||
value="MeshOptSloppy" />
|
||||
<item
|
||||
name="Use LoD above"
|
||||
label="Use LoD above"
|
||||
|
|
@ -572,9 +622,21 @@
|
|||
label="Load from file"
|
||||
value="Load from file" />
|
||||
<item
|
||||
name="Generate"
|
||||
label="Generate"
|
||||
value="Generate" />
|
||||
name="MeshOpt Auto"
|
||||
label="Generate Auto"
|
||||
value="MeshOpt Auto" />
|
||||
<item
|
||||
name="MeshOptCombine"
|
||||
label="Generate Precise"
|
||||
value="MeshOptCombine" />
|
||||
<item
|
||||
name="MeshOpt"
|
||||
label="Generate per face"
|
||||
value="MeshOpt" />
|
||||
<item
|
||||
name="MeshOptSloppy"
|
||||
label="Generate Sloppy"
|
||||
value="MeshOptSloppy" />
|
||||
<item
|
||||
name="Use LoD above"
|
||||
label="Use LoD above"
|
||||
|
|
|
|||
|
|
@ -600,14 +600,6 @@ class WindowsManifest(ViewerManifest):
|
|||
# Get shared libs from the shared libs staging directory
|
||||
with self.prefix(src=os.path.join(self.args['build'], os.pardir,
|
||||
'sharedlibs', self.args['configuration'])):
|
||||
|
||||
# Mesh 3rd party libs needed for auto LOD and collada reading
|
||||
try:
|
||||
self.path("glod.dll")
|
||||
except RuntimeError as err:
|
||||
print (err.message)
|
||||
print ("Skipping GLOD library (assumming linked statically)")
|
||||
|
||||
# Get fmodstudio dll if needed
|
||||
if self.args['fmodstudio'] == 'ON':
|
||||
if(self.args['configuration'].lower() == 'debug'):
|
||||
|
|
@ -1455,7 +1447,6 @@ class DarwinManifest(ViewerManifest):
|
|||
"libapr-1.0.dylib",
|
||||
"libaprutil-1.0.dylib",
|
||||
"libexpat.1.dylib",
|
||||
"libGLOD.dylib",
|
||||
# libnghttp2.dylib is a symlink to
|
||||
# libnghttp2.major.dylib, which is a symlink
|
||||
# to libnghttp2.version.dylib. Get all of them.
|
||||
|
|
@ -2112,7 +2103,6 @@ class Linux_i686_Manifest(LinuxManifest):
|
|||
self.path("libaprutil-1.so.0.4.1")
|
||||
self.path("libdb*.so")
|
||||
self.path("libexpat.so.*")
|
||||
self.path("libGLOD.so")
|
||||
self.path("libuuid.so*")
|
||||
self.path("libSDL-1.2.so.*")
|
||||
self.path("libdirectfb-1.*.so.*")
|
||||
|
|
|
|||
Loading…
Reference in New Issue