-
Notifications
You must be signed in to change notification settings - Fork 156
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
Conversation
tools/specs/lib/optimizeGlbSpec.js
Outdated
@@ -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, |
There was a problem hiding this comment.
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.
Thanks @shehzan10! @lilleyse please merge when ready. |
Requested change fixed. Thanks for reviewing! |
There was a problem hiding this 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. | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments for optimizeI3dm
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b3dm -> i3dm
tools/specs/lib/optimizeGlbSpec.js
Outdated
@@ -24,6 +24,38 @@ describe('optimizeGlb', function() { | |||
}), done).toResolve(); | |||
}); | |||
|
|||
it('optimizes and compresses a glb using the gltf-pipeline', function(done) { |
There was a problem hiding this comment.
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.
tools/specs/lib/optimizeGlbSpec.js
Outdated
quantize: false, | ||
removeNormals: false, | ||
textureCompressionOptions: [ { quality: 10, format: 'dxt1' } ] | ||
}; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Textures -> Textured
Updated to gltf-pipeline 0.1.0-alpha11 and made a quick fix to call |
gltf-pipeline
options to the tools command line.Requires minimum CesiumGS/gltf-pipeline#204 to be used in package.json. So the specs might fail in CI.
Fixes #44