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

Defined in:

docs/a_getting_started/b_installation.cr

Class Method Summary

Class Method Detail

def self.topic_01_shard_dependency : Nil #

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

def self.topic_02_cli_compilation : Nil #

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

def self.topic_03_addon_installation : Nil #

Installing the Godot Editor Addon: Installing the GDExtension plugin into a target Godot project.

To install CRShader into an existing Godot project:

  1. Use the CLI tool:
    bin/crshader install-addon /path/to/godot_project
  2. Or copy the addons/crshader folder directly into your project's addons/ directory.
  3. 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.