likangning93 / gltf-pipeline

Content pipeline tools for optimizing glTF assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glTF Pipeline

License Build Status Coverage Status

Content pipeline tools for optimizing glTF assets by Richard Lee and the Cesium team.

This project is under active development, see the roadmap.

gltf-pipeline can be used as a command-line tool or Node.js module.

Instructions

Clone this repo and install Node.js. From the root directory of this repo, run:

npm install

Command-Line Example:

node ./bin/gltf-pipeline.js ./specs/data/boxTexturedUnoptimized/CesiumTexturedBoxTest.gltf -o output.gltf

Command-Line Flags

Flag Description Required
-i, --input Path to the input glTF file. ✅ Yes
-o, --output Directory or filename for the exported glTF file. No
-b, --binary Write binary glTF file. No, default false
-s, --separate Writes out separate geometry/animation data files, shader files and textures instead of embedding them in the glTF file. No, default false
-h, --help Display help No
-t, --separateTexture Write out separate textures, but embed geometry/animation data files, and shader files. No, default false
-q, --quantize Quantize attributes using WEB3D_quantized_attributes extension. No, default false
-n, --encodeNormals Oct-encode the normals of this model. No, default false
-c, --compressTextureCoordinates Compress the texture coordinates of this model. No, default false

Build Instructions

Run the tests:

npm run test

To run JSHint on the entire codebase, run:

npm run jsHint

To run JSHint automatically when a file is saved, run the following and leave it open in a console window:

npm run jsHint-watch

Running test coverage

Coverage uses istanbul. Run:

npm run coverage

For complete coverage details, open coverage/lcov-report/index.html.

The tests and coverage covers the Node.js module; it does not cover the command-line interface, which is tiny.

Debugging

  • To debug the tests in Webstorm, open the Gulp tab, right click the test task, and click Debug 'test'.
  • To run a single test, change the test function from it to fit.

Contributions

Pull requests are appreciated! Please use the same Contributor License Agreement (CLA) and Coding Guide used for Cesium.


About

Content pipeline tools for optimizing glTF assets

License:Other


Languages

Language:JavaScript 99.3%Language:GLSL 0.7%