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
| Directory | Suggested contents |
|---|---|
DShader/Materials | Project material .dsm files, usually containing Shader. |
DShader/Functions | Project material-function .dsf files, usually containing ShaderFunction. |
DShader/Shared | Project-local shared .dsh files. |
DShader/Packages | Third-party or team packages installed by the VSCode extension. |
Naming Suggestions
| Type | Suggestion |
|---|---|
| Material file | M_*.dsm |
| Material-function file | F_*.dsf |
| Shared header | Name by domain, such as Texture.dsh or Color.dsh. |
| Package entry | Library/<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.