From 5e2bac01cb6e8d3de3cc0e496d94a729e4740247 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 30 Apr 2024 17:26:48 -0500 Subject: #1357 GLTF Export Prototype --- indra/newview/gltfscenemanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index d286f335e4..ec50a0952f 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -40,6 +40,9 @@ namespace LL void load(); // open filepicker to choose asset void load(const std::string& filename); // load asset from filename + void saveAs(); // open filepicker and choose file to save selected asset to + void save(const std::string& filename); // save selected asset to filename + void update(); void render(bool opaque, bool rigged = false); void renderOpaque(); -- cgit v1.2.3 From 170765fd3505410dced83b342f87030fd9151e35 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 30 Apr 2024 21:57:42 -0500 Subject: #1357 Proof of concept on decomposing a GLTF scene into its component parts --- indra/newview/gltfscenemanager.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index ec50a0952f..57d9e019a5 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -41,7 +41,9 @@ namespace LL void load(const std::string& filename); // load asset from filename void saveAs(); // open filepicker and choose file to save selected asset to - void save(const std::string& filename); // save selected asset to filename + void save(const std::string& filename); // save selected asset to filename (suitable for use in external programs) + void decomposeSelection(); // open file picker and choose a location to decompose to + void decomposeSelection(const std::string& filename); // decompose selected asset into simulator-ready .gltf, .bin, and .j2c files void update(); void render(bool opaque, bool rigged = false); -- cgit v1.2.3 From a701cce8e0959503156a010683f6d0d57beaae36 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Wed, 1 May 2024 09:51:32 -0500 Subject: #1357 Preserve asset "extras" and switch to std::shared_ptr for referencing Asset from LLViewerObject to cut down rebuild time --- indra/newview/gltfscenemanager.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index 57d9e019a5..e380be7e3c 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -28,6 +28,16 @@ #include "llsingleton.h" #include "llviewerobject.h" +class LLVOVolume; +class LLDrawable; + +namespace LL +{ + namespace GLTF + { + class Asset; + } +} namespace LL { -- cgit v1.2.3 From 799ebf21624edb8b42ca16b8cf51c138643efd32 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 10 May 2024 15:16:06 +0200 Subject: Fix broken merge and BOOL/bool issues --- indra/newview/gltfscenemanager.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index e380be7e3c..8f29f34c30 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -61,10 +61,10 @@ namespace LL void renderAlpha(); LLDrawable* lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, - BOOL pick_transparent, - BOOL pick_rigged, - BOOL pick_unselectable, - BOOL pick_reflection_probe, + bool pick_transparent, + bool pick_rigged, + bool pick_unselectable, + bool pick_reflection_probe, S32* node_hit, // return the index of the node that was hit S32* primitive_hit, // return the index of the primitive that was hit LLVector4a* intersection, // return the intersection point @@ -72,7 +72,7 @@ namespace LL LLVector4a* normal, // return the surface normal at the intersection point LLVector4a* tangent); // return the surface tangent at the intersection point - bool lineSegmentIntersect(LLVOVolume* obj, GLTF::Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_unselectable, S32* face_hitp, S32* primitive_hitp, + bool lineSegmentIntersect(LLVOVolume* obj, GLTF::Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32* face_hitp, S32* primitive_hitp, LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent); void renderDebug(); -- cgit v1.2.3 From 03c4458bdcc6821a3047f93b729d412e274ab9af Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 20 May 2024 13:22:55 -0500 Subject: #1392 GLTF Upload (#1394) * #1392 WIP -- Functional texture upload, stubbed out .bin upload. * #1392 GLTF Upload WIP -- Emulates successful upload Successfully uploads texture Emulates successful .gltf and .bin upload by injecting into local asset cache. Emulates rez from inventory by setting sculpt ID of selected object Currently fails in tinygltf parsing due to missing .bin * Add missing notification * Build fix * #1392 Add boost::json .gltf reading support. * #1392 boost::json GLTF writing prototype * Create gltf/README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * #1392 Add ability to render directly from LL::GLTF::Material * Fix for mac build * Mac build fix * #1392 AssetType and Inventory Type plumbing * #1392 More sane error handling and scheduling of uploads. * #1392 Actually attempt to upload glbin * Mac build fix, upload nudge * Mac build fix * Fix glTF asset uploads to server * Mac build fix (inline not static) * More consistent inline * Add glm, mac nudge. * #1392 For consistency with spec, start using glm over glh:: and LLFoo * Another attempt at placating Mac builds * Another Mac nudge * Mac build take 23 * #1392 Prune LLMatrix4a from GLTF namespace. * #1392 Fix for orientation being off (glm::quat is wxyz, not xyzw) * #1392 WIP -- Actually send the sculpt type and id, nudge readme and alpha rendering * #1392 Working download! * #1394 Add support for GLTFEnabled SimulatorFeature * #1392 Review feedback --------- Co-authored-by: Pepper Linden <3782201+rohvani@users.noreply.github.com> --- indra/newview/gltfscenemanager.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index 8f29f34c30..a6754d0484 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -54,6 +54,7 @@ namespace LL void save(const std::string& filename); // save selected asset to filename (suitable for use in external programs) void decomposeSelection(); // open file picker and choose a location to decompose to void decomposeSelection(const std::string& filename); // decompose selected asset into simulator-ready .gltf, .bin, and .j2c files + void uploadSelection(); // decompose selected asset and upload to simulator void update(); void render(bool opaque, bool rigged = false); @@ -77,7 +78,18 @@ namespace LL void renderDebug(); + void addGLTFObject(LLViewerObject* object, LLUUID gltf_id); + static void onGLTFLoadComplete(const LLUUID& id, LLAssetType::EType asset_type, void* user_data, S32 status, LLExtStat ext_status); + static void onGLTFBinLoadComplete(const LLUUID& id, LLAssetType::EType asset_type, void* user_data, S32 status, LLExtStat ext_status); + std::vector> mObjects; + + std::shared_ptr mUploadingAsset; + bool mGLTFUploadPending = false; + LLPointer mUploadingObject; + U32 mPendingImageUploads = 0; + U32 mPendingBinaryUploads = 0; + U32 mPendingGLTFUploads = 0; }; } -- cgit v1.2.3 From 2f4120038429c6aff865f153f708ceefb60d67f4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 28 May 2024 09:45:40 -0500 Subject: Remove tinygltf dependency from LL::GLTF (#1541) * #1535 Image loading/saving support in boost::json driven GLTF parser * #1536 GLB Support in boost::json drvien GLTF parser --- indra/newview/gltfscenemanager.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index 5434f6ddb2..53b4ff0e4e 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -52,8 +52,6 @@ namespace LL void saveAs(); // open filepicker and choose file to save selected asset to void save(const std::string& filename); // save selected asset to filename (suitable for use in external programs) - void decomposeSelection(); // open file picker and choose a location to decompose to - void decomposeSelection(const std::string& filename); // decompose selected asset into simulator-ready .gltf, .bin, and .j2c files void uploadSelection(); // decompose selected asset and upload to simulator void update(); -- cgit v1.2.3 From 15fd13f83036ff781160957a21bb2d59771044bc Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 May 2024 16:56:39 -0500 Subject: #1530 Increase joint limit for GLTF Assets (#1582) * Migrate GLTF scene rendering to its own shaders * Add support for ambient occlusion map separate from metallic roughness map (or absent) * Use UBO's for GLTF joints * Better error handling of downloading GLTF assets --- indra/newview/gltfscenemanager.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index 53b4ff0e4e..fcde6cf1f7 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -28,17 +28,11 @@ #include "llsingleton.h" #include "llviewerobject.h" +#include "gltf/common.h" + class LLVOVolume; class LLDrawable; -namespace LL -{ - namespace GLTF - { - class Asset; - } -} - namespace LL { class GLTFSceneManager : public LLSimpleton @@ -56,6 +50,11 @@ namespace LL void update(); void render(bool opaque, bool rigged = false); + void render(LL::GLTF::Asset& asset, bool opaque, bool rigged); + + // bind the given material for rendering + void bind(LL::GLTF::Asset& asset, LL::GLTF::Material& material); + void renderOpaque(); void renderAlpha(); @@ -71,7 +70,7 @@ namespace LL LLVector4a* normal, // return the surface normal at the intersection point LLVector4a* tangent); // return the surface tangent at the intersection point - bool lineSegmentIntersect(LLVOVolume* obj, GLTF::Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32* face_hitp, S32* primitive_hitp, + bool lineSegmentIntersect(LLVOVolume* obj, LL::GLTF::Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32* face_hitp, S32* primitive_hitp, LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent); void renderDebug(); @@ -88,6 +87,8 @@ namespace LL U32 mPendingImageUploads = 0; U32 mPendingBinaryUploads = 0; U32 mPendingGLTFUploads = 0; + + U32 mJointUBO = 0; }; } -- cgit v1.2.3 From 227e9be06832515fd10eb496d4a2a4528d1ebd92 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 10 Jun 2024 10:43:38 -0500 Subject: #1654 generate normals and tangents according to gltf specification (#1662) * Disable unloading of objects in background. * Add unlit GLTF shader variant --- indra/newview/gltfscenemanager.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/gltfscenemanager.h') diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h index fcde6cf1f7..7da413e8b2 100644 --- a/indra/newview/gltfscenemanager.h +++ b/indra/newview/gltfscenemanager.h @@ -49,8 +49,13 @@ namespace LL void uploadSelection(); // decompose selected asset and upload to simulator void update(); - void render(bool opaque, bool rigged = false); - void render(LL::GLTF::Asset& asset, bool opaque, bool rigged); + void render(bool opaque, bool rigged = false, bool unlit = false); + + // render the given variant of all assets + // variant - bitmask according to LLGLSLShader::GLTFVariant flags + void render(U8 variant); + + void render(LL::GLTF::Asset& asset, U8 variant); // bind the given material for rendering void bind(LL::GLTF::Asset& asset, LL::GLTF::Material& material); -- cgit v1.2.3