Resource API Docs

Materials Resource API

Resource API Index

Purpose

Material helpers load source-backed materials or create runtime Material3D data directly.

Materials Resource API explains behavior, constraints, and practical usage so implementation decisions stay consistent across scripts and scenes.

API Source

Functions

material_load!material_reserve!material_drop!material_create!

Enums

Material3D

Constants

presets: Standard/Unlit/Toon/Custom

Types

ResourceWindowMaterialIDMaterial3DScriptContext

Usage Pattern

let mat = material_load!(res, "res://materials/hero.pmat");let custom = material_create!(res, Material3D::Custom(    CustomMaterial3D::new("res://shaders/glow.wgsl")));

Key Details

load/reserve/drop are source-cache operations.

material_create! bypasses source lookup for generated materials.

Presets: Standard, Unlit, Toon, Custom.

Custom materials carry a shader path and typed params.