module
CrShader::Docs::C_EDITOR_TOOLING::B_SHADER_STUDIO
Overview
Godot 4.8 Shader Editor Tab, New Shader (Ctrl+N) & Templates
CRShader integrates directly into Godot 4.8's built-in bottom Shader Editor dock and Create Shader dialog (Ctrl+N)
via CrShader::ShaderCreateDialogIntegration, CrShader::ShaderEditorIntegration, and CrShader::CrShaderTabEditor,
while retaining CrShader::CrShaderStudioPanel for standalone showcase apps. Pressing Ctrl+N in the Shader Editor
(or choosing New Shader... in the FileSystem dock or a ShaderMaterial Inspector) exposes CRShader right inside
the Type: dropdown alongside 30+ curated templates across all 7 shader modes.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Ctrl+N New Shader Dialog & Built-in Templates | .topic_01_dock_layout |
Creating .crshader files with curated templates directly from Godot's Create Shader dialog. |
| Multi-Target emit_target Compilation & Live Sync | .topic_02_live_recompilation |
Automatic syncing of .gdshader, .gdshaderinc, and .glsl outputs on save. |
Related Guides & Source References
- src/crshader/editor/shader_create_dialog_integration.cr
- src/crshader/templates.cr
- src/crshader/editor/shader_editor_integration.cr
- src/crshader/addon.cr
Defined in:
docs/c_editor_tooling/b_shader_studio.crClass Method Summary
-
.topic_01_dock_layout : Nil
Ctrl+N New Shader Dialog & Built-in Templates: Creating .crshader files with curated templates directly from Godot's Create Shader dialog.
-
.topic_02_live_recompilation : Nil
Multi-Target emit_target Compilation & Live Sync: Automatic syncing of .gdshader, .gdshaderinc, and .glsl outputs on save.
Class Method Detail
Ctrl+N New Shader Dialog & Built-in Templates: Creating .crshader files with curated templates directly from Godot's Create Shader dialog.
When res://addons/crshader/plugin.cfg is enabled (either standalone or compiled into a single-GC
Lapis host via require "crshader/addon"), CrShaderPlugin augments Godot's Shader Editor and Create Shader dialog:
- Native
Ctrl+N(Create Shader) Integration: Selecting CRShader inType:unlocks all 7 modes (Spatial, Canvas Item, Particles, Sky, Fog, Compute, and Shader Include) and populatesTemplate:with over 30 ready-to-compile templates (Toon/Cel, Dissolve & Hit Flash, Foliage Wind, Water Waves, Hologram Shield, Triplanar, 2D Sprite Outline, UI SDF Card, Screen Post-Process, CRT Dither, Vortex Particles, Sunset Starfield, Rolling Mist, Compositor Outlines, Compute Particle Sim, and OOP.gdshaderinclibraries). - In-Place
.crshaderTabs & Template Picker: Opening or creating a.crshaderresource upgrades its Shader Editor tab slot withCrShaderTabEditor, featuring a📋 Template...picker,🧩 Insert Trait...dropdown, syntax highlighting, and live split preview. - Toolbar Menu & Companion Jump: Adds a
🔮 CRShaderdropdown (➕ New CRShader...,📋 New CRShader from Template, project.crshaderfiles, and bulk compile) plus a contextual🔮 Edit <name>.crshaderbutton whenever viewing a generated.gdshader,.gdshaderinc, or.glslfile.
Working Examples
emit_target "outline.gdshader", pattern_default_enabled: false
emit_target "pattern_replace.gdshader", pattern_default_enabled: true
shader_type :spatial
render_mode :unshaded
Multi-Target emit_target Compilation & Live Sync: Automatic syncing of .gdshader, .gdshaderinc, and .glsl outputs on save.
Pressing Ctrl+S or clicking Compile & Sync in CrShaderTabEditor (or saving via ResourceSaver)
invokes Compiler#compile_emit_targets, writing every declared emit_target file to disk and updating
any cached Godot::Shader instances in memory for instant viewport hot-reload.