Enum in ldk_material.h

LDKMaterialAlphaMode

typedef enum LDKMaterialAlphaMode{
  LDK_MATERIAL_ALPHA_MODE_OPAQUE=0,
  LDK_MATERIAL_ALPHA_MODE_CUTOUT=1,
  LDK_MATERIAL_ALPHA_MODE_BLEND=2
}LDKMaterialAlphaMode;
Struct in ldk_material.h

LDKMaterialDesc

typedef struct LDKMaterialDesc{
  LDKMaterialType type;
  LDKMaterialArgs args;
  LDKMaterialSurfaceArgs surface;
  LDKAssetImage additional_textures[LDK_MATERIAL_ADDITIONAL_TEXTURE_COUNT];
  u32 texture_slot_mask;
  LDKMaterialTextureSettings texture_settings[LDK_MATERIAL_TEXTURE_SLOT_COUNT];
  LDKAssetTextureAtlas texture_atlases[LDK_MATERIAL_TEXTURE_SLOT_COUNT];
  u64 texture_regions[LDK_MATERIAL_TEXTURE_SLOT_COUNT];
  LDKMaterialAlphaMode alpha_mode;
  float alpha_cutoff;
}LDKMaterialDesc;
Struct in ldk_material.h

LDKMaterialSurfaceArgs

typedef struct LDKMaterialSurfaceArgs{
  float specular;
  float shininess;
  float emission;
  LDKAssetImage normal_map;
  LDKAssetImage specular_map;
}LDKMaterialSurfaceArgs;
Enum in ldk_material.h

LDKMaterialType

typedef enum LDKMaterialType{
  LDK_MATERIAL_TYPE_INVALID=0,
  LDK_MATERIAL_TYPE_TEXTURED_UNLIT=1,
  LDK_MATERIAL_TYPE_TEXTURED=2,
  LDK_MATERIAL_TYPE_VERTEX_COLOR_UNLIT=3,
  LDK_MATERIAL_TYPE_VERTEX_COLOR=4
}LDKMaterialType;
Struct in ldk_material.h

LDKMaterialVertexColorArgs

typedef struct LDKMaterialVertexColorArgs{
  rgba32 color;
}LDKMaterialVertexColorArgs;
Function in ldk_material.h

ldk_material_desc_defaults

Initialize a material descriptor with deterministic defaults. Every supported material type defaults to opaque white, opaque alpha mode, and a 0.5 cutout threshold. Textured materials also default to a null image asset, nearest filtering, no mip filtering, clamp-to-edge wrapping, and identity UV transform. Additional texture slots default to null. Lit materials default to no specular contribution, shininess 32, no emission, and no normal/specular maps. On failure, out_desc is reset to an invalid zero descriptor.

LDK_API bool ldk_material_desc_defaults(
 LDKMaterialType type,
 LDKMaterialDesc *out_desc
);

Parameters

LDKMaterialType type
Material type whose defaults should be produced.
LDKMaterialDesc *out_desc
Destination descriptor.

Returns

true on success, false for an invalid type or null destination.

Function in ldk_material.h

ldk_material_desc_hash

Hash the active values of a material descriptor.

LDK_API u64 ldk_material_desc_hash(LDKMaterialDesc const *desc);

Parameters

LDKMaterialDesc const *desc
Descriptor to hash.

Returns

Deterministic hash, or zero for a null or invalid descriptor.

Function in ldk_material.h

ldk_material_desc_is_valid

Check whether a descriptor has a supported material type. This validates the descriptor structure only. Asset availability is validated later by the asset/material resolver. Textured cutout thresholds must be finite and within [0, 1]. Active lit surface values must be finite and non-negative. A zero shininess is canonicalized to the default value (32) so zero-initialized descriptors remain valid.

LDK_API bool ldk_material_desc_is_valid(LDKMaterialDesc const *desc);

Parameters

LDKMaterialDesc const *desc
Descriptor to inspect.

Returns

true when the descriptor is structurally valid.

Function in ldk_material.h

ldk_material_type_is_valid

Check whether a value identifies a supported material type.

LDK_API bool ldk_material_type_is_valid(LDKMaterialType type);

Parameters

LDKMaterialType type
Material type to inspect.

Returns

true for a supported material type, false otherwise.