Skip to main content
Version: 1.0.0

MaterialPresets

Purpose​

The MaterialPresets collection stores predefined sets of material parameters used for rendering. The documents in this collection are created, stored, and used for applying presets to glasses materials via 3D AR Viewer MaterialPresets page. Each document contains all the necessary properties and values required to apply a specific preset to a material, ensuring consistent and efficient rendering of 3D models' materials.

Document schema​

{
"anisotropy": "number",
"attenuationColor": "string",
"attenuationDistance": "number",
"blendDst": "number",
"blendEquation": "number",
"blendSrc": "number",
"blending": "number",
"clearcoat": "number",
"color": "string",
"depthFunc": "number",
"depthTest": "boolean",
"depthWrite": "boolean",
"dispersion": "number",
"emissive": "string",
"emissiveIntensity": "number",
"ior": "number",
"iridescence": "number",
"iridescenceIOR": "number",
"metalness": "number",
"name": "string",
"newMaterialName": "string",
"opacity": "number",
"roughness": "number",
"sheen": "number",
"sheenColor": "string",
"sheenRoughness": "number",
"side": "number",
"specularColor": "string",
"specularIntensity": "number",
"thickness": "number",
"transmission": "number",
"transparent": "boolean"
}

Indexes​

This collection does not have external indexes.

Query examples​

// Fetch every preset in MaterialPresets collection
const presetsCollection = collection(db, "MaterialPresets");

// Get every Document Snapshot from the collection
const presetsSnapshot = await getDocs(query(presetsCollection));

// Query by material preset name
const materialPresetbyName = query(
collection(db, "MaterialPresets"),
where("name", "==", materialPreset.name)
);