donmccurdy / donmccurdy/glTF-Transform

Support compressing KTX2 textures without CLI

Open
#675 31 comments 4 reactions 0 assignees View on GitHub
dependencies feature package:functions
Dominant language
TypeScript
Stars
2k
Forks
206
Avg merge
2d 2h
Merged PRs (30d)
16

Description

**Is your feature request related to a problem? Please describe.**
I'm in the process of updating from 2.1.7 to 2.4.2 (due to the toktx command changes), but running into what looks like "incorrect but somehow working" use of the library.

In 2.1.7, we were using something like
```
import { NodeIO, PropertyType } from '@gltf-transform/core';
import { draco, toktx } from "@gltf-transform/cli";
...
await document.transform(
// see https://github.com/donmccurdy/glTF-Transform/blob/main/packages/cli/src/transforms/toktx.ts
toktx({ mode: Mode.ETC1S }),
draco(),
);
```

It looks like in 2.4.2 `draco` has moved into `/functions`, but otherwise this still works.

How can we use the simplicity of the toktx command but not depend on the CLI? Might be missing something obvious here!

Contributor guide

Open the contributing guide

Research direction

Start with the toktx transform in packages/cli/src/transforms/toktx.ts, which the issue links, and compare it with the current functions export where draco now lives. Determine what is required to expose equivalent KTX2 compression without depending on the CLI. Done means a programmatic transform can provide the toktx behavior independently of the CLI.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.