Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture and functional changes to gltf repo to divide into components #39

Closed
wants to merge 7 commits into from

Conversation

blgrossMS
Copy link

@blgrossMS blgrossMS commented Aug 19, 2017

[/] Created a .NET schema parsing project and a Unity project to have as separation between parsing and scene construction. This involved moving around files to various directories
[-] Removed all data storage from schema layer. Moved the data storage to be in unity layer
[+] Added in support to load all data from file streams
[+] Added support for building on the UWP platform
[/] Added unit test for .NET schema parser
[/] Refactored API names and moved position of API's to make logic clearer

Blake Gross added 7 commits August 5, 2017 00:23
Merging in changes from HoloToolkit (kurtie@microsoft.com) to add UWP support
Beginning of work to separate out code into multiple projects. Moved Unity into it's own folder, and created base projects for non-Unity dll
…ayer

Moved files that should go in C# layer from Unity layer
…ling

[+] Added color class to store color data and provide some constant values
[~] Switched over classes to use System.Numerics
[+] Added tests to verify that JSON parses correctly
[~] Added basic stream functionality
[~] Made load byte buffer an overload of the loader
[~] Reworked the loader API
[~] Added todo's to get working in Unity
[~] Added stream loader option for IRandomAccessStream
[~] Made UWP project use proper files
[~] Added Newtonsoft.JSON nuget for UWP project
[~] Added UWP unit test
…ionality working again

[-] Removed async code from non-UWP version
[+] Added AssetCache to Unity layer which keeps track of loaded assets needed to construct a scene
[-] Removed all data caching from base layer
[~] Added IEnumerator functionality back to Unity layer
[~] Moved BuildMeshAttributes to GLTFLoader
[~] Renamed Unity's GLTFLoader to GLTFUnityLoader
[-] Removed System.Numerics and replaces it with basic storage classes
[~] Created helper function to convert the basic storage classes
[~] reenabled material caching
[~] Fixed various bugs that caused files not to load
[~] Hooked up first step stream support for unity layer
[-] Removed loading API's from C# layer
[~] Made all build targets AnyCPU (unit test UWP requires x86 or x64 so there is a custom for that)
[~] Readded glb support
[~] Fixed disabled tests
[~] Made serialize and deserialize api's work with TextReader and TextWriter
@stevenvergenz
Copy link
Contributor

Wow, this is a huge PR! Kind of hard to review something that touches every file in the project. Could you explain some of these to me? Specifically:

  1. Scene construction and schema parsing were already separated, weren't they? All the construction work happened in GLTFLoader, and the schema classes were only for de/serializing and storage.
  2. If I understand your second bullet, the schema classes are now strictly de/serializing, and the data is stored in Unity? So there's no intermediate data structure anymore?

@blgrossMS
Copy link
Author

blgrossMS commented Aug 19, 2017 via email

@robertlong
Copy link
Contributor

robertlong commented Aug 21, 2017

Thanks for making this PR Blake! There's a lot of good stuff in here. Excited to see changes that bring UWP support.

I'm a big fan of splitting out the JSON serialization/deserialization into a separate DLL. There's really no need to have JSON serialization/deserialization in the Unity project and a lot of benefit to those using C# in separating it from the Unity loader.

@bghgary commented in our email exchange about using glTF-CSharp-Loader for serialization/deserialization. It has some benefits like generating its parser from the glTF JSON Schema, but it's also considerably slower because it generates classes and then uses JSON.NET's reflection based parsing. I did some testing on the reflection based parsing in #10 and I don't think we should return to that method. However, we could modify glTF-CSharp-Loader to use the manual JSON.NET serialization/deserialization that we have in UnityGLTF. I'm starting to think that this is the best path forward. It would give a huge speed boost to anyone already using the C# loader, UnityGLTF could focus solely on Unity related things and we could avoid duplicated efforts.

I'm happy to put in the work to make this happen if we decide this is a good path forward.

@robertlong robertlong closed this Aug 21, 2017
@robertlong robertlong reopened this Aug 21, 2017
@blgrossMS
Copy link
Author

Modifying the glTF CSharp Loader to support manual serialization/deserialization sounds fine to me. So would the work flow then be:

  1. You do the work to change the architecture of the codebase to utilize the loader
  2. Once that is complete I'll merge the changes and then send out a new PR of the changes that I have made to the Unity project?

@robertlong robertlong mentioned this pull request Aug 30, 2017
@sbtron sbtron added this to Todo in Road to 1.0 Sep 14, 2017
@sbtron sbtron moved this from Todo to In Progress in Road to 1.0 Sep 14, 2017
@blgrossMS blgrossMS closed this Sep 27, 2017
@blgrossMS
Copy link
Author

PR was split up into PR's #44 and #41

@sbtron sbtron moved this from In Progress to Done in Road to 1.0 Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants