module CrShader::Docs

Overview

The CrShader::Docs module is the authoritative technical reference and documentation guide.

Learning Tracks & Topic Index

The documentation is paced into 5 distinct tracks:

1. Getting started (A_GETTING_STARTED)

Submodule Title Description
A_OVERVIEW CRShader Architecture & Transpiler Pipeline Overview of the CRShader language, AST compilation model, and transparent Godot integration.
B_INSTALLATION Installation & Project Setup Adding CRShader to Godot projects, configuring shards, and building the standalone compiler.
C_QUICK_START Quick Start: Authoring Your First Shader Writing a canvas_item tint shader, assigning it to a Sprite2D, and inspecting live compilation.

2. Language dsl (B_LANGUAGE_DSL)

Submodule Title Description
A_SHADER_TYPES Shader Types & Render Modes Canvas item (2D), spatial (3D), particles, sky, fog, and compute shader types with render modes.
B_UNIFORMS_AND_VARYINGS Uniforms, Varyings & Built-In Variables Declaring typed uniforms with hints, passing data across stages via varyings, and accessing engine built-ins.
C_PIPELINE_STAGES Pipeline Stages: Vertex, Fragment & Light Writing code blocks for stage :vertex, stage :fragment, and stage :light.
D_COMPOSITOR_AND_COMPUTE Compositor Passes & Compute Shaders Authoring screen-space compositor post-processing effects and parallel compute shaders.

3. Editor tooling (C_EDITOR_TOOLING)

Submodule Title Description
A_IN_EDITOR_HIGHLIGHTER CRShader & Target Syntax Highlighting How CRShader tokenizes .crshader DSL and compiled .gdshader/.glsl targets with high-contrast dark-theme palettes.
B_SHADER_STUDIO Godot 4.8 Shader Editor Tab, New Shader (Ctrl+N) & Templates Native CRShader creation via Ctrl+N (New Shader), 30+ built-in templates, split-pane Shader Editor tabs, and multi-target emit_target syncing.
C_CLI_AND_STUBS CRShader CLI Tool & IDE Stubs Standalone CLI compiler commands, directory watcher, and Crystal IDE completion stub generation.

4. Showcase and benchmarks (D_SHOWCASE_AND_BENCHMARKS)

Submodule Title Description
A_PERFORMANCE_BENCHMARKS Compiler Performance & Throughput Benchmarks Quantitative compiler benchmarks measuring AST parsing, transpilation throughput, and memory overhead.
B_SHADER_VIEWER Interactive Shader Viewer & Sandbox Standalone showcase application featuring 20+ procedural shaders, 3D mesh switcher, and live sandbox.

5. Output comparisons (E_OUTPUT_COMPARISONS)

Submodule Title Description
A_SIDE_BY_SIDE_COMPARISONS Complete CRShader Side-by-Side Output Atlas Side-by-side source vs compiled output comparisons (.gdshader, .gdshaderinc, Vulkan .glsl, --release -O, and Lapis Host Nodes) across all 12 CRShader special feature families.

Defined in:

docs.cr
docs/a_getting_started/a_overview.cr
docs/a_getting_started/b_installation.cr
docs/a_getting_started/c_quick_start.cr
docs/b_language_dsl/a_shader_types.cr
docs/b_language_dsl/b_uniforms_and_varyings.cr
docs/b_language_dsl/c_pipeline_stages.cr
docs/b_language_dsl/d_compositor_and_compute.cr
docs/c_editor_tooling/a_in_editor_highlighter.cr
docs/c_editor_tooling/b_shader_studio.cr
docs/c_editor_tooling/c_cli_and_stubs.cr
docs/d_showcase_and_benchmarks/a_performance_benchmarks.cr
docs/d_showcase_and_benchmarks/b_shader_viewer.cr
docs/e_output_comparisons/a_side_by_side_comparisons.cr

Class Method Summary

Class Method Detail

def self.topic_01_quick_start : Nil #

Quick-Start Commands: Essential commands for building, running, and testing.

CrShader Quick Start:

make docs        # Build offline HTML documentation site in docs/
make test        # Execute specifications and test suites
make all         # Build and verify all targets

def self.topic_02_reading_paths : Nil #

Learning Tracks & Reading Paths: Curated reading order from beginner to advanced.

Structured Learning Tracks

1. Getting started (A_GETTING_STARTED)
  • A_GETTING_STARTED::A_OVERVIEW: **CRShader Architecture & Transpiler Pipeline** — Overview of the CRShader language, AST compilation model, and transparent Godot integration.
  • A_GETTING_STARTED::B_INSTALLATION: **Installation & Project Setup** — Adding CRShader to Godot projects, configuring shards, and building the standalone compiler.
  • A_GETTING_STARTED::C_QUICK_START: Quick Start: Authoring Your First Shader — Writing a canvas_item tint shader, assigning it to a Sprite2D, and inspecting live compilation.
2. Language dsl (B_LANGUAGE_DSL)
  • B_LANGUAGE_DSL::A_SHADER_TYPES: **Shader Types & Render Modes** — Canvas item (2D), spatial (3D), particles, sky, fog, and compute shader types with render modes.
  • B_LANGUAGE_DSL::B_UNIFORMS_AND_VARYINGS: **Uniforms, Varyings & Built-In Variables** — Declaring typed uniforms with hints, passing data across stages via varyings, and accessing engine built-ins.
  • B_LANGUAGE_DSL::C_PIPELINE_STAGES: **Pipeline Stages: Vertex, Fragment & Light** — Writing code blocks for stage :vertex, stage :fragment, and stage :light.
  • B_LANGUAGE_DSL::D_COMPOSITOR_AND_COMPUTE: **Compositor Passes & Compute Shaders** — Authoring screen-space compositor post-processing effects and parallel compute shaders.
3. Editor tooling (C_EDITOR_TOOLING)
  • C_EDITOR_TOOLING::A_IN_EDITOR_HIGHLIGHTER: **CRShader & Target Syntax Highlighting** — How CRShader tokenizes .crshader DSL and compiled .gdshader/.glsl targets with high-contrast dark-theme palettes.
  • C_EDITOR_TOOLING::B_SHADER_STUDIO: **Godot 4.8 Shader Editor Tab, New Shader (Ctrl+N) & Templates** — Native CRShader creation via Ctrl+N (New Shader), 30+ built-in templates, split-pane Shader Editor tabs, and multi-target emit_target syncing.
  • C_EDITOR_TOOLING::C_CLI_AND_STUBS: **CRShader CLI Tool & IDE Stubs** — Standalone CLI compiler commands, directory watcher, and Crystal IDE completion stub generation.
4. Showcase and benchmarks (D_SHOWCASE_AND_BENCHMARKS)
5. Output comparisons (E_OUTPUT_COMPARISONS)
  • E_OUTPUT_COMPARISONS::A_SIDE_BY_SIDE_COMPARISONS: Complete CRShader Side-by-Side Output Atlas — Side-by-side source vs compiled output comparisons (.gdshader, .gdshaderinc, Vulkan .glsl, --release -O, and Lapis Host Nodes) across all 12 CRShader special feature families.

def self.topic_03_table_of_contents : Nil #

Master Table of Contents: Complete hierarchical topic index.

Complete Documentation Index

A_GETTING_STARTED
  • A_GETTING_STARTED::A_OVERVIEW: **CRShader Architecture & Transpiler Pipeline** — Overview of the CRShader language, AST compilation model, and transparent Godot integration.
  • A_GETTING_STARTED::B_INSTALLATION: **Installation & Project Setup** — Adding CRShader to Godot projects, configuring shards, and building the standalone compiler.
  • A_GETTING_STARTED::C_QUICK_START: Quick Start: Authoring Your First Shader — Writing a canvas_item tint shader, assigning it to a Sprite2D, and inspecting live compilation.
B_LANGUAGE_DSL
  • B_LANGUAGE_DSL::A_SHADER_TYPES: **Shader Types & Render Modes** — Canvas item (2D), spatial (3D), particles, sky, fog, and compute shader types with render modes.
  • B_LANGUAGE_DSL::B_UNIFORMS_AND_VARYINGS: **Uniforms, Varyings & Built-In Variables** — Declaring typed uniforms with hints, passing data across stages via varyings, and accessing engine built-ins.
  • B_LANGUAGE_DSL::C_PIPELINE_STAGES: **Pipeline Stages: Vertex, Fragment & Light** — Writing code blocks for stage :vertex, stage :fragment, and stage :light.
  • B_LANGUAGE_DSL::D_COMPOSITOR_AND_COMPUTE: **Compositor Passes & Compute Shaders** — Authoring screen-space compositor post-processing effects and parallel compute shaders.
C_EDITOR_TOOLING
  • C_EDITOR_TOOLING::A_IN_EDITOR_HIGHLIGHTER: **CRShader & Target Syntax Highlighting** — How CRShader tokenizes .crshader DSL and compiled .gdshader/.glsl targets with high-contrast dark-theme palettes.
  • C_EDITOR_TOOLING::B_SHADER_STUDIO: **Godot 4.8 Shader Editor Tab, New Shader (Ctrl+N) & Templates** — Native CRShader creation via Ctrl+N (New Shader), 30+ built-in templates, split-pane Shader Editor tabs, and multi-target emit_target syncing.
  • C_EDITOR_TOOLING::C_CLI_AND_STUBS: **CRShader CLI Tool & IDE Stubs** — Standalone CLI compiler commands, directory watcher, and Crystal IDE completion stub generation.
D_SHOWCASE_AND_BENCHMARKS
E_OUTPUT_COMPARISONS
  • E_OUTPUT_COMPARISONS::A_SIDE_BY_SIDE_COMPARISONS: Complete CRShader Side-by-Side Output Atlas — Side-by-side source vs compiled output comparisons (.gdshader, .gdshaderinc, Vulkan .glsl, --release -O, and Lapis Host Nodes) across all 12 CRShader special feature families.