Sets brush base color texture (texture handle from b3dLoadTexture or similar).
Takes brushHandle (brush handle), textureHandle (texture index from texture loading functions).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
brushHandleInt
textureHandleInt
Returns
Void
Quick Summary
Sets brush base color texture (texture handle from b3dLoadTexture or similar).
Takes brushHandle (brush handle), textureHandle (texture index from texture loading functions).
Returns nothing.
Technical Exegesis...
Sets brush base color texture (texture handle from b3dLoadTexture or similar). Takes brushHandle (brush handle), textureHandle (texture index from texture loading functions). Returns nothing. Validates brush handle, stores textureHandle in brush.textureIndex. Texture multiplied with base color during rendering (texture color * brush color * vertex color).
This function assigns texture to brush for textured materials.
Sets brush base color texture (texture handle from b3dLoadTexture or similar). Takes brushHandle (brush handle), textureHandle (texture index from texture loading functions). Returns nothing. Validates brush handle, stores textureHandle in brush.textureIndex. Texture multiplied with base color during rendering (texture color * brush color * vertex color).
This function assigns texture to brush for textured materials. Texture handle: index from texture loading functions (b3dLoadTexture, b3dLoadAnimTexture, etc.), references texture in global g_textures array. No texture validation (allows forward references, runtime loading). Rendering behavior: if textureIndex >= 0, shader samples texture and multiplies with base color, if textureIndex < 0 (default -1), no texture sampling (solid color only). Color multiplication: final color = texture RGB * base color RGB * vertex color RGB. Use cases: (1) Textured surfaces (brick, wood, metal textures), (2) UV-mapped meshes (procedural geometry with texture coordinates), (3) Texture atlases (single texture with multiple sub-images), (4) Detail textures (high-frequency surface detail), (5) Color maps (diffuse/albedo textures in PBR). Common pattern: tex=b3dLoadTexture("brick.png"), brush=b3dCreateBrush(), b3dBrushTexture(brush, tex), b3dBrushColor(brush, 200, 200, 200), b3dPaintSurface(mesh, 0, brush), creates slightly darkened brick surface. Default: -1 (no texture) after b3dCreateBrush. Tinting: combine with b3dBrushColor for colored textures, white (255,255,255) = no tint (shows texture as-is), colored = tints texture (red tint on white texture = red texture). Alpha channel: if texture has alpha, multiplied with brush alpha (texture.a * brush.a). UV coordinates: mesh must have valid UV coordinates (set via b3dAddVertex u,v or b3dVertexTexCoords) for texture mapping. Missing UVs result in undefined mapping. Texture filtering: uses trilinear filtering with mipmaps for smooth appearance (implementation detail). PBR workflow: this is base color/albedo texture in PBR (physically based rendering), represents surface diffuse color without lighting. Handle validation: invalid brush handles ignored. Texture validity: not validated during set (allows deferred loading), invalid textures may cause rendering issues. Property update: affects future b3dPaintSurface calls only. Storage: texture index stored in brush.textureIndex, copied to material.baseColorTextureIndex during paint. Related: b3dLoadTexture loads textures from files, b3dBrushColor sets tint color, b3dPaintSurface applies textured brush to surface.