Filament Material
Syntax highlighting for Google Filament material
definitions (.mat) in Visual Studio Code.

Filament materials are two languages in one file, and this extension treats them that
way:
- The
material { ... } block highlights as structured data — property keys (quoted or
unquoted), strings, numbers, booleans, and parameter types (float3, float4x4,
sampler2d, ...) each get their own scope, with nested objects and arrays handled
properly.
fragment { ... }, vertex { ... }, and compute { ... } bodies embed C++
highlighting, the closest built-in match for Filament's GLSL dialect —
MaterialInputs, materialParams, and your shader code all render as code, not
string soup.
Line-comment toggling (//), bracket matching, and auto-closing pairs are included.
Inside shader blocks the C++ comment commands apply; the material block offers only //
because matc does not accept /* */ there.
Installation
Search Filament Material in the Extensions view, or:
ext install abnormalvector.filament-mat
Using Unity?
Unity also stores its (YAML) material assets as .mat. In a workspace that mixes both,
scope the association by path in .vscode/settings.json — Unity materials live under
Assets/:
{
"files.associations": { "**/Assets/**/*.mat": "yaml" }
}
For a pure Unity workspace, "*.mat": "yaml" works, and any single file can be flipped
with the language mode picker in the status bar.
Notes
- Blocks may be indented, but a block's closing brace is expected at the same
indentation as its opening keyword — standard formatting — because TextMate grammars
can't count braces through arbitrary shader code. A differently formatted file
degrades to plainer highlighting rather than breaking.
- This is a community extension, not affiliated with or endorsed by Google or the
Filament project.
Developing
git clone https://github.com/abnormalvector/vscode-filament-mat.git
ln -s "$(pwd)/vscode-filament-mat" ~/.vscode/extensions/abnormalvector.filament-mat-0.1.0
Reload VS Code; grammar edits apply on the next reload. samples/example.mat is a
matc-verified material that exercises every scope the grammar knows — open it to eyeball
changes.
License
MIT — © 2026 Abnormal Vector