playcanvas / playcanvas/engine
Implement USDZ exporter improvements
@mvaligursky is already working on this.
Since Nov 10, 2022.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
PR https://github.com/playcanvas/engine/pull/4638 implemented initial functionality of USDZ export, and these are additional bits that would improve it's quality:
-
scene hierarchy. At the moment, mesh instances are exported without a hierarchy, each directly with a world matrix. A hierarchy would be useful when animations are exported.
-
animation support
-
skinning / morphing support
-
precision - all mesh attributes (positions, uvs ..) are exported at full precision, and could be stored with lower precision to limit the size. Example:
point3f[] points = [(-33.66764831542969, 3.8385066986083984, 19.865646362304688) ...
-
additional vertex attributes (for example vertex colors)
-
additional texture formats. All textures are presently stored in .png format. We could add jpg format if alpha channel is not required.
-
texture transform
There is partial support implemented, but does not work in many cases:
float inputs:rotation = ${rotation}
float2 inputs:scale = (${tiling.x}, ${tiling.y})
float2 inputs:translation = (${offset.x}, ${offset.y})
https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_texture_transform/README.md
https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html#transform2d
-
roughness / glossiness
at the moment, the texture is assumed to be a roughness (to match gltf specification). In case PlayCanvas material is used in the scene, this most likely is a glossiness, and we could perhaps handle it this way: https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html#roughness-vs-glossiness -
support additional material settings (clearcoat, ior, sheen) - see more here https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html#preview-surface
-
texture repeat / clamp - at the moment, wrap is hardcoded
token inputs:wrapS = "repeat"
token inputs:wrapT = "repeat"
- alpha testing - the code is there, see
opacityThreshold, but using it seems to fail to load in the built in MacOS viewer. Needs further investigation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.