Skip to content

using cli for transform jpg/png to ktx2 (basis, uastc) #1495

Answered by donmccurdy
arpu asked this question in Q&A
Discussion options

You must be logged in to vote

Here's an example:

// Texture compression.
if (opts.textureCompress === 'ktx2') {
const { default: encoder } = await import('sharp');
const slotsUASTC = micromatch.makeRe(
'{normalTexture,occlusionTexture,metallicRoughnessTexture}',
MICROMATCH_OPTIONS,
);
transforms.push(
toktx({
encoder,
resize: [opts.textureSize, opts.textureSize],
mode: Mode.UASTC,
slots: slotsUASTC,
level: 4,
rdo: true,
rdoLambda: 4,
limitInputPixels: options.limitInputPixels as boolean,
}),
toktx({
encoder,
resize: [opts.textureSize, opts.te…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arpu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants