Implement a commandline interface that can be used in scripts - implements #42

This commit is contained in:
ChaoticByte 2025-01-19 12:51:10 +01:00
parent 1a21589fc1
commit 0fad7cb575
No known key found for this signature in database
4 changed files with 100 additions and 17 deletions

View file

@ -74,3 +74,33 @@ void fragment() {
COLOR = hsv_offset(COLOR, 0.32, 0.2, 0.0);
}
```
## Commandline interface
You can run Fragmented from the commandline or scripts.
> Note: Headless mode is not supported. Using the commandline interface still opens a window.
### Usage
```
./Fragmented cmd --shader PATH [--load-image PATH]
--shader PATH The path to the shader
--output PATH Where to write the resulting image to
--load-image PATH The path to the image. This will overwrite the
load directive of the shader file (optional)
```
You can also run `./Fragmented cmd help` to show the help message.
#### Examples
```
./Fragmented cmd --shader ./examples/oklab.gdshader --output ./output.png
```
```
./Fragmented cmd --shader ./examples/oklab.gdshader --load-image ~/Pictures/test.png --output ./output.png
```