module
CrShader::Docs::A_GETTING_STARTED::B_INSTALLATION
Overview
Installation & Project Setup
Setting up CRShader can be done either as an in-project GDExtension addon for the Godot Editor, or as a standalone command-line compiler for automated CI pipelines and pre-compilation workflows.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Adding the Shard Dependency | .topic_01_shard_dependency |
Configuring shard.yml to include CRShader in your Crystal project. |
| Building the Standalone CLI | .topic_02_cli_compilation |
Compiling the standalone crshader executable for command-line use. |
| Installing the Godot Editor Addon | .topic_03_addon_installation |
Installing the GDExtension plugin into a target Godot project. |
Related Guides & Source References
- bin/crshader/shard.yml
- bin/crshader/Makefile
- bin/crshader/src/cli.cr
Defined in:
docs/a_getting_started/b_installation.crClass Method Summary
-
.topic_01_shard_dependency : Nil
Adding the Shard Dependency: Configuring shard.yml to include CRShader in your Crystal project.
-
.topic_02_cli_compilation : Nil
Building the Standalone CLI: Compiling the standalone crshader executable for command-line use.
-
.topic_03_addon_installation : Nil
Installing the Godot Editor Addon: Installing the GDExtension plugin into a target Godot project.
Class Method Detail
Adding the Shard Dependency: Configuring shard.yml to include CRShader in your Crystal project.
To author shaders or use the programmatic compiler API inside your Crystal game or tooling,
add crshader to your project's shard.yml:
dependencies:
crshader:
github: sol-vin/crshader
branch: master
Run shards install to fetch CRShader and its dependencies.
Working Examples
shards install
shards check
Building the Standalone CLI: Compiling the standalone crshader executable for command-line use.
The standalone crshader executable provides batch compilation, file watching, and IDE
stub generation without launching the Godot Editor.
Run make inside the crshader repository, or compile src/cli.cr directly:
Working Examples
# Via Makefile:
make
# Or direct crystal build:
crystal build src/cli.cr -o bin/crshader --release
Installing the Godot Editor Addon: Installing the GDExtension plugin into a target Godot project.
To install CRShader into an existing Godot project:
- Use the CLI tool:
bin/crshader install-addon /path/to/godot_project - Or copy the
addons/crshaderfolder directly into your project'saddons/directory. - Open Godot, navigate to Project -> Project Settings -> Plugins, and check Enable next to CRShader.
Common Pitfalls & Safety Caveats
- Warning: Ensure your Godot project uses Godot 4.8 or later; earlier 4.x versions lack certain GDExtension resource loader hooks.