DreamShaderLang
Getting Started

Recommended Project Layout

Directory conventions for .dsm, .dsf, .dsh, and packages.

DreamShaderLang source files are placed in the project-root DShader directory by default. Separating materials, material functions, and shared headers keeps imports predictable and makes dependency tracking easier.

ProjectRoot/
├─ DShader/
│  ├─ Materials/
│  │  └─ M_Sample.dsm
│  ├─ Functions/
│  │  └─ F_Tint.dsf
│  ├─ Shared/
│  │  ├─ Common.dsh
│  │  └─ Color.dsh
│  └─ Packages/
│     └─ @typedreammoon/
│        └─ dream-noise/
│           ├─ dreamshader.package.json
│           └─ Library/
│              └─ Noise.dsh
└─ Plugins/
   └─ DreamShader/

Directory Roles

DirectorySuggested contents
DShader/MaterialsProject material .dsm files, usually containing Shader.
DShader/FunctionsProject material-function .dsf files, usually containing ShaderFunction.
DShader/SharedProject-local shared .dsh files.
DShader/PackagesThird-party or team packages installed by the VSCode extension.

Naming Suggestions

TypeSuggestion
Material fileM_*.dsm
Material-function fileF_*.dsf
Shared headerName by domain, such as Texture.dsh or Color.dsh.
Package entryLibrary/<Name>.dsh

Import Maintainability

Prefer a small number of stable entry imports in .dsm files:

import "Shared/Common.dsh";
import "@typedreammoon/dream-noise/Library/Noise.dsh";

Avoid deep-importing many implementation files from every material. When .dsf or .dsh files change, DreamShader can then refresh the dependent .dsm and function files more accurately.

On this page