Sets entity metallic factor (0.0=dielectric, 1.0=metal, clamped 0.0-1.0). Takes entity (mesh entity handle), metallic (0.0-1.0 double). Returns nothing. Clamps metallic to 0.0-1.0 range, updates material metallicFactor, sets metallicRoughnessTextureIndex=1 (default white texture) so factor controls metallic exclusively. Mesh entities only.
This function sets metallic property. Metallic meaning: PBR property controlling how material reflects light (0.
Sets entity metallic factor (0.0=dielectric, 1.0=metal, clamped 0.0-1.0). Takes entity (mesh entity handle), metallic (0.0-1.0 double). Returns nothing. Clamps metallic to 0.0-1.0 range, updates material metallicFactor, sets metallicRoughnessTextureIndex=1 (default white texture) so factor controls metallic exclusively. Mesh entities only.
This function sets metallic property. Metallic meaning: PBR property controlling how material reflects light (0.0 = dielectric/non-metal like plastic/wood/stone with diffuse reflection, 1.0 = metal like gold/steel/aluminum with specular reflection and tinted reflections). Value clamping: input clamped to 0.0-1.0 range (negative values become 0.0, values > 1.0 become 1.0). Material handling: surface-based meshes (procedural shapes) update all surface materials directly, loaded meshes (GLB models) use material override system (checks entity.materialOverrideIndex, uses override if exists else uses mesh.materialIndex). Texture override: sets metallicRoughnessTextureIndex=1 (default white texture index) so metallicFactor is ONLY thing controlling metallic (without this texture values would multiply with factor, causing unexpected results). Use cases: (1) Metal objects (1.0 for gold/steel/aluminum realistic metal sheen), (2) Non-metal objects (0.0 for plastic/wood/fabric matte diffuse look), (3) Mixed materials (0.5 for semi-metallic oxidized metal, painted metal), (4) Dynamic weathering (animate from 1.0 to 0.5 for rusting metal), (5) Material variation (same model different metallic for variety). Common patterns: full metal b3dSetEntityMetallicFX(entity, 1.0), non-metal b3dSetEntityMetallicFX(entity, 0.0), oxidized metal b3dSetEntityMetallicFX(entity, 0.5), dynamic rust metallicValue = metallicValue - 0.01 until 0.0. Typical usage: set to 1.0 for metal objects (weapons, armor, coins), set to 0.0 for non-metal objects (wood, cloth, plastic), animate for weathering effects (rusting metal). PBR metallicFactor: determines Fresnel reflectance and reflection color (metals have tinted reflections matching baseColor, dielectrics have white reflections at grazing angles), affects energy conservation (metals have no diffuse only specular, dielectrics have both). Metallic workflow: metallic and roughness control surface properties (metallic = what kind of material, roughness = how smooth), baseColor interpreted differently (for metals baseColor = reflection tint, for dielectrics baseColor = diffuse albedo). Material override: uses same clone-on-write pattern as SetEntityColorFX (prevents shared material modification). Performance: O(1) for single surface mesh, O(N) for N-surface procedural mesh. Default value: likely 0.0 (non-metallic) if not set (verify during testing). Validation: prints error if invalid mesh handle or non-mesh entity, prints error if entity has no material. Related: b3dSetEntityRoughnessFX sets surface roughness (companion property), b3dSetEntityColorFX sets base color (interpreted differently based on metallic), b3dGetEntityMetallicFX reads current metallic value.