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

Gltf Importer #1030

Closed
wants to merge 41 commits into from
Closed

Gltf Importer #1030

wants to merge 41 commits into from

Conversation

ykafia
Copy link
Contributor

@ykafia ykafia commented Mar 9, 2021

PR Details

This PR aims to add SharpGLTF as an asset loader for gltf/glb files

Description

  • Added a project Stride.Importer.Gltf
  • Added the necessary files to handle the gltf importer in Stride.Assets.Model

Related Issue

#603
#336 (to some extent)

Motivation and Context

glTF is a relatively new 3d scene file specification, being able to store way more information than common specifications. It's open source and doesn't need any native binding of any sort. It's also a very well supported file specification across well known 3D softwares (Maya, 3DSMax, Blender, ZBrush)

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Gltf samples working

multi model files are annotated with MM

  • 2CylinderEngine
  • AlphaBlendModeTest
  • AnimatedCube
  • AnimatedMorphCube
  • AnimatedMorphSphere
  • AnimatedTriangle
  • AntiqueCamera
  • Avocado
  • BarramundiFish
  • BoomBox
  • BoomBoxWithAxes
  • Box
  • Box With Spaces
  • BoxAnimated
  • BoxInterleaved
  • BoxTextured
  • BoxTexturedNonPowerOfTwo
  • BoxVertexColors
  • BrainStem
  • Buggy
  • Cameras
  • CesiumMan
  • CesiumMilkTruck
  • ClearCoatTest
  • Corset
  • Cube
  • DamagedHelmet
  • Duck
  • EnvironmentTest
  • FlightHelmet
  • Fox
  • GearboxAssy
  • InterpolationTest
  • Lantern
  • MaterialsVariantsShoe
  • MetalRoughSpheres
  • MetalRoughSpheresNoTextures
  • MorphPrimitivesTest
  • MorphStressTest
  • MultiUVTest
  • NormalTangentMirrorTest
  • NormalTangentTest
  • OrientationTest
  • ReciprocatingSaw
  • RiggedFigure
  • RiggedSimple
  • SciFiHelmet
  • SheenChair
  • SheenCloth
  • SimpleMeshes
  • SimpleMorph
  • SimpleSkin
  • SimpleSparseAccessor
  • SpecGlossVsMetalRough
  • Sponza
  • Suzanne
  • TextureCoordinateTest
  • TextureEncodingTest
  • TextureSettingsTest
  • TextureTransformMultiTest
  • TextureTransformTest
  • ToyCar
  • TransmissionTest
  • Triangle
  • TriangleWithoutIndices
  • TwoSidedPlane
  • UnlitTest
  • VC
  • VertexColorTest
  • WaterBottle

@ykafia
Copy link
Contributor Author

ykafia commented Mar 9, 2021

I'm sorry for creating another pull request, i preferred creating it from another branch instead of my master!
Also @xen2 do you have a bit of time to help me with the Stride.Importer.Gltf.csproj parameters i need to add ? I have a bit of trouble understanding how to integrate the project well in Stride.
The issue being : when i compile Stride.Importer.Gltf, dlls of the referenced projects are not found (TFM issue it seems)

ykafia and others added 3 commits March 13, 2021 19:53
[Build] Force .NET version so that NuGet doesn't get upgraded behind …
@dnfadmin
Copy link

dnfadmin commented Mar 25, 2021

CLA assistant check
All CLA requirements met.

@ykafia ykafia changed the title Gltf Importer [WIP] Gltf Importer Mar 25, 2021
@ykafia
Copy link
Contributor Author

ykafia commented Apr 2, 2021

Known issues so far

  • Color vertex models render weirdly (most likely due to a bad VertexDeclaration conversion
  • Normal map textures are correctly imported but render fails on some models (DamagedHelmet and Fox). It might be due to the fact that i extract the textures and save them (probably in the wrong format)

@ykafia
Copy link
Contributor Author

ykafia commented Aug 5, 2021

  • Importing scenes as a whole, with lights and cameras.
  • Multi model scenes import, currently only imports the first model present in the scene. Related to first point. Reason for that is because importing a model in Game Studio is designed to import one object only.
  • Only vanilla gltf specification is supported, some extensions can be added though

@Eideren
Copy link
Collaborator

Eideren commented Aug 5, 2021

I see, I'm pretty sure the fbx importer imports multiple models as one model asset, I think it makes sense for the gltf importer to replicate that behavior ?

@ykafia
Copy link
Contributor Author

ykafia commented Aug 5, 2021

Haven't realized that about fbx but yes it makes sense to replicate this behavior, i think i had a draft somewhere about merging gltf meshes, animations will need more work though

@YanYas

This comment has been minimized.

@Eideren

This comment has been minimized.

@YanYas

This comment has been minimized.

@Eideren
Copy link
Collaborator

Eideren commented Aug 5, 2021

Oi, again, just create a new issue mate, this is out of scope of this PR.

@Eideren
Copy link
Collaborator

Eideren commented Jan 4, 2022

Hello @ykafia, how's this PR coming along ? Should I mark this PR as a draft or is this ready to be reviewed ?

@ykafia
Copy link
Contributor Author

ykafia commented Jan 4, 2022

You can mark it as a draft, I will focus my attention on the Assimp PR.

@Eideren Eideren marked this pull request as draft January 4, 2022 13:13
@Aggror
Copy link
Member

Aggror commented Jan 21, 2022

Would this topic be available for funding from the open collective?

@NicusorN5
Copy link
Contributor

Hey, any progress on this?

@ykafia
Copy link
Contributor Author

ykafia commented Dec 2, 2022

Not much progress except I've made a C# port of MikktSpace tangent generation.

@tebjan
Copy link
Member

tebjan commented Dec 6, 2022

MikktSpace tangent generation

Shouldn't we use the tangent generation that we already have, because it will fit with the Stride PBR material shaders?

@vjgegenlicht
Copy link

Are there any updates on this? Im sure people would support an open collective as mentioned before. It could even be related to the opencollective project about support for multiple animations per file. An update would be nice since we have already prototyped a vvvv vl.stride plugin for GLTF but having it work in stride itself would be much nicer since everyone would benifit.

@ykafia
Copy link
Contributor Author

ykafia commented Nov 18, 2023

Very old PR, should be started again since it's in conflict with the assimp library.

@ykafia ykafia closed this Nov 18, 2023
@ykafia ykafia deleted the gltfimport branch November 18, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants