GithubHelp home page GithubHelp logo

gltf-toolkit's Issues

Need help with creating draco mesh straight from gltf-sdk

Hi,

I've been trying to use the toolkit with the gltf-SDK to generate a .glb file with Draco mesh compression. (without the file being saved by the SDK first.)

I keep getting the error Buffer.uri was not specified

If I try the .gltf file there is heap corruption at

auto bufferView = builder->AddBufferView(buffer.data(), buffer.size());

This is what buffer.data() prints for a buffer of any size :
DRACO☻☻☺☺

Any help would be appreciated, thanks!

Redundant textures in output after specular gloss -> metal rough conversion

I noticed that after the conversion of the spec gloss textures to metal rough that they still are present in the output

Here's the sheets compared between 1.5.0 and 1.6.0 when running glTF-Toolkit/glTF-Toolkit.Test/Resources/gltf/WaterBottle/WaterBottle.gltf. The spec gloss textures are still present in the textures/images arrays in 1.6.0 (indices: 0, 1, 5, 6).

LOD merge with tangents fails

LOD merge causes the tangents from the highest LOD to be used where it really should use the tangents from the appropriate LOD instead.

I think all that's needed is a line in GLTFLODUtils.cpp::AddGLTFNodeLOD:
...
AddIndexOffset(primitive.tangentsAccessorId, accessorOffset);
...

Cant work with GLTF

Hello,

I want to use the gltf-Toolkit in my projekt to convert gltf-Files to glb-Files for the Mixed Reality Viewer.
First I tried directly to use
var converted = await WindowsMRConversion.ConvertAssetForWindowsMR(tempGltfFile, outputFolder, 512, TexturePacking.OcclusionRoughnessMetallic);
but the result is always a empty ( 0 byte) glb file (without the "_converted" extention on the filename).

next I tried to first serialize the gltf-File to glb an then use the Conversion Methode.

StorageFile sourceGlbFile = await GLTFSerialization.PackGLTFAsync(gltfFile, ApplicationData.Current.LocalFolder, glbfileName);

Here I got direct an exeption "System.Runtime.InteropServices.COMException" in System.Private.CoreLib.ni.dll"

For my tests I use the BoomBox.gltf and Avocado.gltf from the Khronos Repod
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/sourceModels

Here my full Methode

` public async Task GLBConvertToWindowsMR()
{
const string gltfFileName = "Avocado.gltf";

        // Pack the gltf back into a glb file
        var gltfFile = await StorageFile.GetFileFromPathAsync(Path.Combine(ApplicationData.Current.LocalFolder.Path, gltfFileName));
        var glbfileName = Path.ChangeExtension(gltfFileName, ".glb");
        StorageFile sourceGlbFile = await GLTFSerialization.PackGLTFAsync(gltfFile, ApplicationData.Current.LocalFolder, glbfileName);


        StorageFile tempGlbFile = await CopyFileToTempFolderAsync(sourceGlbFile.Path);
        StorageFolder outputFolder = await CreateTemporaryOutputFolderAsync("Out_" + Path.GetFileNameWithoutExtension(gltfFileName));


        var converted = await WindowsMRConversion.ConvertAssetForWindowsMR(tempGlbFile, outputFolder, 512, TexturePacking.OcclusionRoughnessMetallic);

    }`

Existing mesh serializing

Hi,
Do you have any documentation on how to create a gltf/glb mesh with more than 1 triangle and probably how to convert an existing mesh (I have mine in STL format) with facets and nodes correspondences.
Thanks!

Project does not build in VS 2019

The project does not build in Visual Studio 2019. I added the /Wv:18 option to the compiler command line and replaced all instances of "std::experimental::filesystem" with "std::filesystem" and that eliminated some errors but more remain and I am giving up.

We couldn't load the selected model, Please try agian later

After conversion for the holographic plattform with the following command without any options:

  • WindowsMRAssetConverter.exe original.glb -o ConvertedFile.glb -platform holographic

I get the aboved error, any sugesstion is appreciated!

(Btw, beofore conversion the error is "Sorry, this model is not optimized for Windows Mixed Reality")

Improve handling of duplicate resources

Given a set of gltf input LODs that have the same materials for each LOD:

  1. the images get packed multiple times (once per GLTF file), even though they could be packed just once if they're identical
  2. the merged GLTF json will contain redundant material information
  3. the exported GLB will as a result embed the same data (textures/images etc) once per LOD level, whereas it should really all share the one set of materials/textures/images

Some possible solutions:

  1. Add a flag to WindowsMRAssetConverter to specify whether the materials are shared between LODs, and if so, make the merger avoid adding new resources.
  2. Detect duplicate resources in the merger by binary comparision, and then resolve/remap all necessary places in the resulting GLTF json. Note that this wouldn't fix the issue with doing packing once per GLTF input file. Pack the images/textures after merging, assuming the merge step has eliminated all duplicates.

WindowsMRAssetConverter Could not parse accessor 0

Hello,

I am trying to use the MSFT_LOD extension for LOD with gltf files and came to this toolkit. I've downloaded the WindowsMRAssetConverter.exe. On running the command I'm getting the following output:

WindowsMRAssetConverter T2H.glb -o T2.glb -lod T2L.glb T1L.glb -screen-coverage 0.5 0.2 0.01

This will generate an asset compatible with Desktop (version 1709+)

Loading input document: T2H.glb...
Could not parse accessor 0
The member bufferView was not found

I had a look at this documentation (https://docs.microsoft.com/en-us/windows/mixed-reality/creating-3d-models-for-use-in-the-windows-mixed-reality-home) but couldn't figure out the issue.

Is it possible to run the converter from some non-Windows system as well and is there a documentation for it? If not, I could help in creating one with a little guidance.

Need help with MSFT_LOD generation for Threejs

Hello,
With threejs, we use https://github.com/takahirox/three-gltf-extensions to successfully load GLTF models that already include MSFT_LOD.
(working GLTF model : https://github.com/takahirox/three-gltf-extensions/tree/main/examples/assets/gltf/Torus/glTF-lod)

But when we try making our own with WindowsMRAssetConverter, no luck doing so, with multiple scenarios:

case 1 : multiple levels are active at the same time and with wild scales
(red and green are 2 separate LODs)
image
Command used on Windows : .\scripts\WindowsMRAssetConverter.exe ./src/models/LOD0Arbre2.gltf -o ./dist/models/arbre.glb -lod ./src/models/LOD1Arbre2.gltf ./src/models/LOD2Arbre2.gltf ./src/models/LOD3Arbre2.gltf ./src/models/LOD4Arbre2.gltf -screen-coverage 0.5 0.45 0.25 0.05 0.001

case 2 : we get Vector errors
image

Can you help us ?
I can share the assets if needed for testing.

-replace-textures flag does not work

When enabled the -replace-textures flag should remove all original textures and references from the optimized file leaving only DDS textures in the final .glb. The flag currently no-ops resulting in bloated files.

Sample glTF files fail to load in Microsoft's own software

The files "glTF-Toolkit/glTF-Toolkit.Test/Resources/gltf/CubeAsset3D.gltf" and "glTF-Toolkit/glTF-Toolkit.Test/Resources/gltf/CubeWithLOD.gltf" fail to load in both Windows explorer preview pane and the Windows 10 3D Viewer program by Microsoft.

Multiples of 4 Texture resizing flag for WinMRAssetConverter

Block compression expects textures to be multiples of 4 to compress correctly. Adding a step to resize textures automatically and toggle this behavior on and off in the converter would provide a fallback when assets aren't authored with this requirement in mind.

crash

Crash on GLTFDocument document = DeserializeJson(*stream);

Unhandled exception at 0x76A308F2 in WindowsMRAssetConverter.exe: Microsoft C++ exception: Microsoft::glTF::InvalidGLTFException at memory location 0x00AFC2F4. occurred

This when loading a gltf file

Pipeline features

Hi! Awesome toolkit you've started here, thanks for doing this. 🙂 Wanted to share some ideas on things that could make this more useful to WebVR devs, and so, (apologies in advance for all the feature requests!) here are some thoughts. In no particular order:

  • Enable building source on Unix systems, or provide binaries. This would allow others to host this as a web UI tool for convenience, see discussion here.
  • Option to merge meshes with shared materials. I see this issue all the time on models from various sources, and many WebVR devs don't realize it's an issue. I use obj-simplify to solve this in OBJ files, and a similar tool for glTF could be helpful.
  • Option to strip specific attributes. For example many models include tangents by default, but environments like three.js and A-Frame currently ignore them, so it's just added weight.
  • Option to merge multiple animated glTF assets into a single asset with multiple animations. If authoring tools begin to support multiple animations they may not be necessary, but currently virtually none do, and it's unclear to me how/if to handle that in Autodesk workflows.

Best,
Don

"Cannot read the magic number"

Trying to compress the file attached, I'm getting the "Cannot read the magic number" message and no results.
Thorus.zip
Does it mean compression is applicable only on gltf files?
Also, can I create Draco compressed glb with MSFT_lods extension?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.