-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Model Tag improvements, fix GLTF import #5606
Conversation
Use existing double->float matrix conversion code, simplify matrix calculation.
Calculating the atmospheric light attenuation for a body is no longer the domain of a ModelBody; it's moved to Camera to be used wherever necessary. This simplifies the rendering code in ModelBody and SpaceStation.
Change the SceneGraph::Model Tag API to use string_view instead of std::string references. The entire API has not been converted due to time and complexity constraints.
- Add a new Tag node that's concerned with storing a model-space global transform and keeping it updated when the model animation state changes. - Tag nodes are now added to their parent nodes according to the model source data, rather than being reparented to the model root. - The SGM_VERSION was bumped given that the new Tag nodes are not backwards compatible. - SceneGraph nodes are now restricted to only having a single parent, as the parent information is required to efficiently calculate the global transform of Tag nodes. - All tag transforms are updated when animations are ticked; this has some future potential for optimization. - Correctly initialize the active animations field of Model.
The Blender GLTF exporter writes the generated text mesh of a text object to the node, needing special-case handling. The Label implementation draws labels pointing towards +Z, which works for Collada models due to the implicit import rotation of the model. Amend the orientation of label nodes when importing from GLTF. Fixup: handle invalid animation node refs GLTF exports a single frame of animation for all objects in the scene, some of which may have been turned into labels or other nodes. Gracefully handle a missing node for these channels and ignore them.
NOTE: this PR introduces an SGM format bump due to the new Tag node, and as such any cached SGM models in your working tree after merge will need to be regenerated. |
How will this affect a player who upgrades their pioneer installation? Do we have some way to set configuration to force-rebuild them once? Just thinking: most players probably don't read the release information or instrucitons. |
Aren't the models generated upon build? |
@nozmajner last time I checked (which was years ago), @fluffyfreak made is so pioneer builds them first time you start pioneer, if they're missing. I don't remember that having been changed. |
We distribute SGM files as part of binary builds of Pioneer, built using CI. For the end-user, they'll just have to delete the old data directory as usual when we make our next release. For developers working from repo, there is a separate facility to generate SGM files in-tree using the model compiler - you'll need to run |
This PR makes model tags a separate object type which is affected and transformed by the model hierarchy in a way that is consistent with the hierarchy of the source file in Blender. This allows tags to be transformed and animated, while still retaining the ability to query their global model-space transform.
I've also made a refactor to how ModelBody lighting is handled, moving responsibility for calculating lighting to the camera/render pass rather than the body object itself. This will be expanded on later with future rendering improvements and is needed for clickable cockpits.
I've also made some minor tweaks to allow the game to load GLTF-format model source files as well as Collada. GLTF is set up so that Blender "text" objects can be imported as Label nodes and the orientation of the node is the same as it appears in Blender.
This branch is a prerequisite for my editor branch and will be merged somewhat quickly.