跳转到内容

ShaderParam

此内容尚不支持你的语言。

Defined in: sdk/src/render/shaderReflect.ts:29

default: number[]

Defined in: sdk/src/render/shaderReflect.ts:35

Default components for a scalar/vector param (length 1–4); empty for a texture.


optional defaultTexture?: string

Defined in: sdk/src/render/shaderReflect.ts:37

Default texture hint for a texture param (e.g. “white”); undefined otherwise.


displayName: string

Defined in: sdk/src/render/shaderReflect.ts:33

Human label for the inspector row (leading u_ stripped, capitalized).


optional group?: string

Defined in: sdk/src/render/shaderReflect.ts:46

group(Name): the parameter group an inspector shows it under (Base, Normal, Emissive…). Absent: no group. A clause the engine’s own parser does not read, so it changes nothing drawn.


optional layered?: true

Defined in: sdk/src/render/shaderReflect.ts:63

Declared textureArray: a 2D texture array, sampled with a layer index (texture(u_x, vec3(uv, layer))). Set it with Material.tex on a handle from createTextureArrayFromPixels. Absent means a plain 2D texture.


name: string

Defined in: sdk/src/render/shaderReflect.ts:30


optional range?: object

Defined in: sdk/src/render/shaderReflect.ts:39

Optional slider bounds from range(min,max).

max: number

min: number


optional texel?: "data"

Defined in: sdk/src/render/shaderReflect.ts:51

texel(data): a texture whose texels this shader reads as numbers (a normal, packed roughness), which sRGB decode would bend. Absent means colour.


type: ShaderParamType

Defined in: sdk/src/render/shaderReflect.ts:31


optional ui?: string

Defined in: sdk/src/render/shaderReflect.ts:41

Optional UI hint from ui(...), e.g. “slider”.


optional worldUnits?: 1 | -1

Defined in: sdk/src/render/shaderReflect.ts:57

unit(length) (1) or unit(perLength) (-1): the default and range are written at 100 world units a metre, the engine’s reference, and follow the project’s units per metre where a material leaves the param unset (ecs/worldUnits.ts; shaderParamInUnits is what an inspector shows). Absent is a plain number.