You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/RFC Feature - USD in the Scene Pipeline.md
+83-29Lines changed: 83 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,24 +183,34 @@ Build support for USD into the scene pipeline.
183
183
184
184
Do this in three phases:
185
185
186
-
1. Upgrade O3DE to use Assimp's latest implementation
187
-
1. Input: single USD geometry files that don't use layers or references
188
-
2. Output: azmodel containing the USDs geometry
189
-
2. Contribute back to Assimp and update scene builder to load USD files with references. Stages are flattened by adding in reference geometry. O3DE then processes USD like FBX and other scene file formats.
190
-
1. Input: USD files which contains a hierarchy of references to other geometry inside of other USD files
191
-
2. Output: Flattened azmodel containing the geometry from the multiple USD files inside one azmodel file
192
-
3. Contribute back to Assimp giving API option to flatten stages or keep reference geom separate. Update O3DE to create a procedural prefab that mimics the relationship graph of USD files by matching models and transforms. This could be expanded later to allow O3DE developers to translate USD properties into O3DE component properties as well as add advanced shaders/materials.
193
-
1. Input: USD files which contains a hierarchy of references to other geometry inside of other USD files
194
-
2. Output: Procedural prefabs generated per USD. Root prefab preserves the hierarchy of the original USD.
186
+
1. Single USD
187
+
1. Upgrade O3DE to use Assimp's latest implementation
188
+
2. Input: single USD geometry files that don't use layers or references
189
+
3. Output: azmodel containing the USDs geometry
190
+
2. USD with References
191
+
1. Update Assimp scene tree with tags for referenced USD files
192
+
2. Update O3DE scene builder to load USD files and look for reference tags.
193
+
3. Update O3DE to create a procedural prefab that mimics the relationship graph of USD files by matching models and transforms
194
+
4. Input: USD files which contains a hierarchy of references to other geometry inside of other USD files
195
+
5. Output: Procedural prefabs generated for the root USD as well as referenced USDs. Root prefab preserves the hierarchy of the original USD.
196
+
3. USD with Variants
197
+
1. Updated Assimp scene tree with tags for variants within a USD
198
+
2. Update O3DE scene builder to load USD files and look for variants
199
+
3. Input: USD file which contains X variants
200
+
4. Output:
201
+
1. X meshes and X prefabs generated for each variant
202
+
2. Prefabs which references a variant in its hierarchy will nest 1 of the prefab variants
195
203
196
204
### Why these three phases?
197
205
198
206
* Phase 1 is extremely fast.
199
-
* The work for phase 2 is used in phase 3, so there won't be much wasted effort here.
200
207
* Once phase 2 is completed, there's great benefits to using USD: content creators can start splitting up content on their end.
201
-
* Benefits of phase:
208
+
* Benefits of phase 2:
202
209
* Performance - asset processing time, and hard drive space used by product assets: We won't need to re-create product assets, such as models, that are referenced by multiple other USD files.
203
210
* Workflow - additional procedural prefabs will be available for content creators to use in the Editor.
211
+
* Phase 3 and beyond nice-to-have.
212
+
* Variants are advanced so makes sense to break them out into a later phase.
213
+
* Avoid variant explosion by only selecting 1 of many variants when generating procedural prefabs
@@ -252,9 +262,9 @@ Warning | The builder (Scene Builder) has not indicated it handled outputting pr
252
262
253
263
Phase 2 enables referencing...
254
264
255
-
### Phase 2 - Update Assimp to support flattened USD with references
265
+
### Phase 2 - Update Assimp to support USD with references
256
266
257
-
Update Assimp to read USDs, composite all sub-layers and references and flatten all the meshes into one Assimp scene. O3DE will treat the root USD as one big mesh.
267
+
Update Assimp to read USDs, composite all sub-layers and tag references in Assimp scene. O3DE will parse the Assimp tree to find references and spin off procedural prefabs.
2. Update Assimp to generate an Assimp scene by flattening and resolving the O3DE scene
301
-
1. Today a USD loaded via Assimp returns a scene, but if that scene references other USD files, the scene won't contain the geometry of the references. Update Assimp to recursively find references and mark them as a file dependency.
310
+
2. Update Assimp to generate an Assimp scene containing a way to recognize references
311
+
1. Today a USD loaded via Assimp returns a scene, but if that scene references other USD files, the scene won't contain the geometry of the references. Update Assimp to recursively find references and tag them as a reference (include necessary data such as file path, and reference name)
312
+
1. Assimp outputs the scene graph like it currently does, but when it hits a reference, it annotates that node in the scene graph with a property that describes the reference.
313
+
1. Assimp::Scene root "kitchen"
314
+
1. child 01
315
+
1. Name: "spoon 01"
316
+
2. Transform: <translation>, <rotation>, <scale>
317
+
3. Reference: "c:/project/spoon.usd"
302
318
303
319
TinyUSDZ, the 3rd Party USD library used by Assimp, has methods for discovering references geometry.
Note: USD can reference other USDs or geometry from other file types (example: obj). As long as the file type is supported by Assimp, we can load this geom and add it to the final flattened Assimp scene.
336
+
Note: USD can reference other USDs or geometry from other file types (example: obj). As long as the file type is supported by Assimp, Assimp can tag it, and O3DE can load the geom and add it to the procedural prefab.
2. Update Create Jobs in the scene builder to output job dependencies on referenced USD files.
344
+
3. [See FAQ for why we need both source and job dependencies](#USDintheScenePipeline-Whydoweneedbothsourcedependenciesandjobdependenciesforreferences?).
345
+
4. Job dependencies will be needed at this point because product assets from one USD file (prefabs, models, etc) will be referenced by other USD files to mimic the USD relationship graph.
346
+
5. Update the scene builder to generate USD based procedural prefabs.
347
+
1. We will need to define what these look like. [We may need additional features from procedural prefabs to hit our end goals](https://wiki.agscollab.com/display/lmbr/USD+in+the+Scene+Pipeline#USDintheScenePipeline-WhatdoweneedfromproceduralprefabsforUSDtobefullyfunctional?).
348
+
349
+
### Phase 3 - Update Assimp to support USD with Variants
350
+
351
+
Variants are switchable references. Ideally, an O3DE component could provide a drop down in editor to quickly select from a list of variants within a variant set, but this phase simply recognizes variants in order to generate a mesh and prefab for each. Any root USD referencing a variant set will make a single variant selection.
352
+
1. Update Assimp to generate an Assimp scene containing a way to recognize variant sets, via tagging
353
+
1. Assimp outputs the scene graph like it currently does, but when it hits a variant, it annotates that node in the scene graph with a property.
354
+
1. Assimp::Scene root "kitchen"
355
+
1. child 01
356
+
1. Name: "spoon 01"
357
+
2. Transform: <translation>, <rotation>, <scale>
358
+
3. Reference: "c:/project/spoon.usd"
359
+
4. Variant: "WoodenSpoonA"
360
+
2. O3DE pipeline would consume this scene
361
+
1. Update scene builder to look for "variant set" and "variant" tags
362
+
2. Update scene builder to generate a procedural prefab for each variant in a variant set
363
+
3. Update scene builder so root USD prefabs referencing a variant set (referenced inline or another .usd file) will have a variant selected for them in their procedural prefab
364
+
1. In instances where the USD calls out a variant set, but no selection, the 1st variant in the variant set list will be selected
* Add a feature flag to toggle USD flattening off, so we can deliver the rest of this work iteratively.
332
-
* Update Create Jobs in the scene builder to output job dependencies on referenced USD files.
333
-
* [See FAQ for why we need both source and job dependencies](#USDintheScenePipeline-Whydoweneedbothsourcedependenciesandjobdependenciesforreferences?).
334
-
* Job dependencies will be needed at this point because product assets from one USD file (prefabs, models, etc) will be referenced by other USD files to mimic the USD relationship graph.
335
-
* Update the scene builder to generate USD based procedural prefabs.
336
-
* We will need to define what these look like. [We may need additional features from procedural prefabs to hit our end goals](https://wiki.agscollab.com/display/lmbr/USD+in+the+Scene+Pipeline#USDintheScenePipeline-WhatdoweneedfromproceduralprefabsforUSDtobefullyfunctional?).
337
-
* Decide if we want to either keep the feature flag for USD flattening and turn it off by default, or remove the flag and remove USD flattening support in process job.
338
-
339
376
Alternate Solutions
340
377
===================
341
378
@@ -378,7 +415,7 @@ Do we need to emit references to other USD files as job dependencies, or can the
378
415
379
416
If we're able to fully rely on procedural prefabs to manage the composition of USD file references, and we're able to predict the sub IDs of products from other USD files, then we may not need to emit these references as source dependencies.
380
417
381
-
USD has support for [abstract base objects](https://wiki.agscollab.com/display/lmbr/USD+Investigation#USDInvestigation-AbstractObjects), that function sort of as inverted overrides. Our prefab system does not have a similar concept, so we may need to output job or source dependencies to use this information to build a prefab hierarchy. We may find that we instead need to add this sort of functionality to prefabs.
418
+
USD has support for abstract base objects, that function sort of as inverted overrides. Our prefab system does not have a similar concept, so we may need to output job or source dependencies to use this information to build a prefab hierarchy. We may find that we instead need to add this sort of functionality to prefabs.
382
419
383
420
### Example
384
421
@@ -464,11 +501,28 @@ Out of Scope / Long Term Work
464
501
465
502
Advanced shaders and materials
466
503
------------------------------
467
-
468
504
For our initial deliverable, we will generate basic O3DE physically based rendering materials.
469
505
470
506
However, the options for shaders and materials from USD files are much bigger than that. As we wrap up our first set of work to support USD, we'll want to start planning what a more fully featured material and shader pipeline from USD files could look like.
471
507
508
+
Extra USD Properties and O3DE Components
509
+
------------------------------
510
+
Allow developers to read generic scene information, and inject custom components into the procedural prefabs generated by importing USD files. O3DE would ship with built-in components.
511
+
1. Update Assimp to output USD property data
512
+
1. Assimp::Scene root "kitchen"
513
+
1. child 01
514
+
1. Name: "spoon 01"
515
+
2. Transform: <translation>, <rotation>, <scale>
516
+
3. Reference: "c:/project/spoon.usd"
517
+
4. Variant: "WoodenSpoonA"
518
+
5. NEW: Other user data/properties/overrides
519
+
520
+
1. O3DE scene system already supports storing generic info into each scene node
521
+
522
+
Editor Variant Selection Dropdown
523
+
------------------------------
524
+
Allow designers to select from a list of available variants from within the editor when a variant set is included in a USD
0 commit comments