Sets brush alpha/transparency (0.0=fully transparent, 1.0=opaque, clamped 0.0-1.0). Takes brushHandle (brush handle), alpha (transparency, clamped 0.0-1.0). Returns nothing. Validates brush handle, clamps alpha to 0.0-1.0 range, sets brush baseColorFactor.w (alpha channel). When applied via b3dPaintSurface, alpha < 1.0 triggers alpha blending (blendMode=1), alpha=1.0 uses solid rendering (blendMode=0).
This function controls brush transparency for semi-transparent materials.
Sets brush alpha/transparency (0.0=fully transparent, 1.0=opaque, clamped 0.0-1.0). Takes brushHandle (brush handle), alpha (transparency, clamped 0.0-1.0). Returns nothing. Validates brush handle, clamps alpha to 0.0-1.0 range, sets brush baseColorFactor.w (alpha channel). When applied via b3dPaintSurface, alpha < 1.0 triggers alpha blending (blendMode=1), alpha=1.0 uses solid rendering (blendMode=0).
This function controls brush transparency for semi-transparent materials. Alpha parameter: opacity/transparency value, 0.0=fully transparent (invisible), 1.0=opaque (solid, no transparency). Clamped automatically to valid 0.0-1.0 range. Blend mode selection: b3dPaintSurface checks alpha when creating material, if alpha < 1.0 sets material.blendMode=1 (alpha blend, renders with transparency), if alpha=1.0 sets material.blendMode=0 (solid, opaque rendering, faster). Use cases: (1) Glass/windows (alpha=0.1-0.3 for see-through), (2) Water surfaces (alpha=0.5-0.7 for semi-transparent), (3) Ghosts/spirits (alpha=0.4-0.6 for translucent), (4) Smoke/fog (alpha=0.2-0.5 for wispy), (5) Decals (alpha from texture alpha channel). Common pattern: brush=b3dCreateBrush(), b3dBrushAlpha(brush, 0.5), creates 50% transparent brush. Default: 1.0 (opaque) after b3dCreateBrush. Alpha blending: when enabled, fragments rendered back-to-front sorted, blended with existing framebuffer (performance cost vs opaque). Performance: transparent objects more expensive than opaque (depth sorting, overdraw, blend operations). Use sparingly. Typical values: glass=0.1-0.3, water=0.5-0.7, fog=0.2-0.4, opaque=1.0. Texture alpha interaction: if texture has alpha channel, final alpha = brush alpha * texture alpha (multiplied). RGB preservation: updates alpha only, preserves RGB color (set via b3dBrushColor). Material property: stored in baseColorFactor.w, copied to material during b3dPaintSurface. Blend mode automatic: no manual blend mode setting needed, determined by alpha value during paint. Handle validation: invalid handles ignored. Property update: affects future b3dPaintSurface calls only. Sorting requirement: for correct transparency, render transparent objects after opaque objects, sorted back-to-front. Related: b3dBrushColor sets RGB (preserves alpha), b3dPaintSurface applies brush and determines blend mode, b3dBrushTexture for textures with alpha channels.