ShaderLab language support for Galacean Engine in Visual Studio Code.
- Syntax highlighting for
.gsand.gsl - Snippets for common ShaderLab structures
- Code completion for ShaderLab symbols and common built-ins
- Hover information
- Signature help
- Diagnostics
- Range formatting
This extension is designed for the main Galacean ShaderLab workflow, including:
Shader,SubShader,PassUsePassEditor,Properties,Macros,UIScriptHeader(...)TagsVertexShader,FragmentShaderRenderQueueTypeBlendState,DepthState,StencilState,RasterState- User-defined
struct, functions, and variables - Common preprocessor lines such as
#include,#if, and#ifdef
Built-in snippets include:
ShaderSubShaderPassEditorPropertiesMacrosUIScriptUsePassTagsHeaderBlendStateDepthStateStencilStateRasterStatestructforifmain
- Install the extension.
- Open a
.gsor.gslfile. - Start writing ShaderLab code with highlighting, snippets, completion, and diagnostics.
Example:
Shader "Example/MyShader" {
Editor {
Properties {
Header("Surface") {
baseColor("Base Color", Color) = (1, 1, 1, 1);
metallic("Metallic", Range(0, 1, 0.01)) = 0;
}
}
UIScript "./ui.ts";
}
SubShader "Default" {
Pass "Forward" {
Tags { pipelineStage = "Forward" }
VertexShader = vert;
FragmentShader = frag;
}
}
}pnpm install
npm run compileTo debug locally in VS Code:
- Open this folder in VS Code.
- Run
Launch Extension. - Open a
.gsor.gslfile in the Extension Development Host.
MIT