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

Add spec and readme example for using compression with optimizeGlb #48

Merged
merged 6 commits into from
Mar 7, 2017
Merged

Add spec and readme example for using compression with optimizeGlb #48

merged 6 commits into from
Mar 7, 2017

Conversation

shehzan10
Copy link
Member

  • To use compression, the use simply has to pass the gltf-pipeline options to the tools command line.
  • Added a spec for using optimizeGlb with compression.

Requires minimum CesiumGS/gltf-pipeline#204 to be used in package.json. So the specs might fail in CI.

Fixes #44

Unverified

This user has not yet uploaded their public signing key.
@@ -24,6 +24,37 @@ describe('optimizeGlb', function() {
}), done).toResolve();
});

it('optimizes and compresses a glb using the gltf-pipeline', function(done) {
var compressionOptions = { aoOptions: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put aoOptions on a new line.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 5, 2017

Thanks @shehzan10!

@lilleyse please merge when ready.

@shehzan10
Copy link
Member Author

Requested change fixed. Thanks for reviewing!

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update pacakage.json to the newest gltf-pipeline release once it is out. I'm going to wait to merge this until then so that I can verify properly.

tools/README.md Outdated
node ./bin/3d-tiles-tools.js optimizeB3dm -i ./specs/data/Textures/batchedTextured.b3dm -o ./output/optimized.b3dm --options --texcomp.dxt1.enable --texcomp.dxt1.quality=5 --texcomp.etc1.enable
```
This example optimizes the b3dm and compresses the textures into `dxt1` and `etc1` formats.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place this example after the other examples above. This part of the description is not needed: from [gltf-pipeline](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/master/README.md) under the --options flag. since it should be clear from the first example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments for optimizeI3dm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batchedTextured.b3dm and instancedTextured.i3dm should be included in this PR if they are used as examples.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding these samples to the repo, can we use any textured models are already a part of it? I can update the readme to point to those files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know we had any textured b3dm/i3dm, but yes point to those if they already exist.

tools/README.md Outdated
```
node ./bin/3d-tiles-tools.js optimizeI3dm -i ./specs/data/Textured/instancedTextured.i3dm -o ./output/optimized.i3dm --options --texcomp.dxt1.enable --texcomp.dxt1.quality=5 --texcomp.etc1.enable
```
This example optimizes the b3dm and compresses the textures into `dxt1` and `etc1` formats.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b3dm -> i3dm

@@ -24,6 +24,38 @@ describe('optimizeGlb', function() {
}), done).toResolve();
});

it('optimizes and compresses a glb using the gltf-pipeline', function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is a bit vague. Just compresses textures in a glb using the gltf-pipeline is fine.

quantize: false,
removeNormals: false,
textureCompressionOptions: [ { quality: 10, format: 'dxt1' } ]
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These options are overkill, just add what's needed.

tools/README.md Outdated
To use tileset texture compression, pass the [`texcomp` flags](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/master/README.md#command-line-flags)
from [gltf-pipeline](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/master/README.md) under the `--options` flag.
```
node ./bin/3d-tiles-tools.js optimizeB3dm -i ./specs/data/Textures/batchedTextured.b3dm -o ./output/optimized.b3dm --options --texcomp.dxt1.enable --texcomp.dxt1.quality=5 --texcomp.etc1.enable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Textures -> Textured

@lilleyse
Copy link
Contributor

lilleyse commented Mar 7, 2017

Updated to gltf-pipeline 0.1.0-alpha11 and made a quick fix to call loadGltfUris prior to optimizing, as this is needed for the compression stage.

@lilleyse lilleyse merged commit bcc566c into CesiumGS:master Mar 7, 2017
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

3 participants