Sets brush shininess/smoothness (0.0=rough/matte, 1.0=shiny/glossy, converted to PBR roughness=1-shininess). Takes brushHandle (brush handle), shininess (smoothness, clamped 0.0-1.0). Returns nothing. Validates brush handle, clamps shininess to 0.0-1.0, converts to roughness via inverse relationship (roughness = 1.0 - shininess), stores in brush.roughnessFactor. Roughness controls specular highlight sharpness in PBR rendering.
This function configures surface smoothness for physically based rendering.
Sets brush shininess/smoothness (0.0=rough/matte, 1.0=shiny/glossy, converted to PBR roughness=1-shininess). Takes brushHandle (brush handle), shininess (smoothness, clamped 0.0-1.0). Returns nothing. Validates brush handle, clamps shininess to 0.0-1.0, converts to roughness via inverse relationship (roughness = 1.0 - shininess), stores in brush.roughnessFactor. Roughness controls specular highlight sharpness in PBR rendering.
This function configures surface smoothness for physically based rendering. Shininess parameter: artist-friendly smoothness value, 0.0=rough/matte (diffuse, no highlights), 1.0=shiny/glossy (sharp specular highlights). Clamped to 0.0-1.0. Roughness conversion: PBR uses roughness (opposite of shininess), roughness = 1.0 - shininess. shininess 0.0 -> roughness 1.0 (very rough), shininess 1.0 -> roughness 0.0 (mirror smooth). Specular behavior: low roughness (high shininess) = tight sharp highlights (polished metal, glass), high roughness (low shininess) = broad diffuse reflection (cloth, concrete). Use cases: (1) Polished metal (shininess=0.9-1.0), (2) Plastic (shininess=0.6-0.8), (3) Wood (shininess=0.3-0.5), (4) Cloth/fabric (shininess=0.0-0.2), (5) Glass (shininess=0.95-1.0). Common pattern: brush=b3dCreateBrush(), b3dBrushShininess(brush, 0.8), b3dBrushMetallic(brush, 1.0), creates shiny metallic material. Default: 0.0 (shininess) / 1.0 (roughness, matte) after b3dCreateBrush. Typical values: mirror=1.0, polished=0.8-0.9, semi-gloss=0.5-0.7, satin=0.3-0.5, matte=0.0-0.2. PBR workflow: roughness factor in metallic-roughness PBR model, controls microfacet distribution (surface microsurface irregularity). Physically based: rough surfaces scatter light broadly (diffuse-like), smooth surfaces reflect light sharply (mirror-like). Interaction with metallic: non-metals (metallic=0) show white highlights, metals (metallic=1) show colored highlights (tinted by base color). Roughness map: this sets uniform roughness, use roughness texture for spatial variation. Handle validation: invalid brush handles ignored. Property update: affects future b3dPaintSurface calls only. Storage: roughness stored in brush.roughnessFactor, copied to material.roughnessFactor during paint. Inverse relationship note: shininess more intuitive (higher=shinier), roughness more physical (higher=rougher), conversion handles discrepancy. Related: b3dBrushMetallic sets metallic/non-metallic (works together with roughness for PBR), b3dPaintSurface applies brush with roughness to surface.