Blitz3D+ Command Reference

BrushBaseColorMap brush[,texture][,frame]

Parameters

brush - brush handle

texture (optional) - colour texture, or 0 to remove the map (default)

frame (optional) - frame of an animated texture; 0 (default)

Description

Sets the colour texture of a Standard material.

The base-colour map is the main "what does this thing look like" texture: brick, skin, painted metal. Its RGB is read as sRGB colour and multiplied by the brush colour set with BrushColor, so you can tint one texture into several team colours from a single image. Its alpha channel is multiplied by BrushAlpha and used according to BrushAlphaMode.

Pass 0 as the texture to remove the map and fall back to the plain brush colour. Calling this command attaches the Standard material to the brush automatically.

For the full map set, see Standard material maps in the shader guide.

Requires Extended mode.

See also: BrushNormalMap, BrushMetallicRoughnessMap, BrushEmissiveMap, BrushAlphaMode, BrushColor.

Example

; BrushBaseColorMap Example
; -------------------------
; Requires Extended mode.

Graphics3D 640,480,0,2
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-5

light=CreateLight()
RotateEntity light,35,-30,0

; Draw a texture by hand: a yellow sun on a blue sky
texture=CreateTexture(64,64,1+8)
SetBuffer TextureBuffer(texture)
ClsColor 40,130,230
Cls
Color 255,220,50
Oval 12,12,40,40,True
SetBuffer BackBuffer()

brush=CreateStandardBrush()
cube=CreateCube()

mapped=True

While Not KeyDown(1)

    ; Press Space to attach or remove the base-colour map
    If KeyHit(57) Then mapped=Not mapped

    ; Set the map (texture zero removes it) and repaint the cube
    If mapped Then BrushBaseColorMap brush,texture Else BrushBaseColorMap brush,0
    PaintEntity cube,brush

    TurnEntity cube,0.2,0.4,0

    ; Arrow keys move the camera
    If KeyDown(200) Then MoveEntity camera,0,0,0.1
    If KeyDown(208) Then MoveEntity camera,0,0,-0.1
    If KeyDown(203) Then TurnEntity camera,0,1,0
    If KeyDown(205) Then TurnEntity camera,0,-1,0

    RenderWorld

    Color 255,255,255
    Text 0,0,"Space: toggle map   Arrow keys: move camera   Esc: exit"
    If mapped Then Text 0,20,"BrushBaseColorMap brush,texture" Else Text 0,20,"BrushBaseColorMap brush,0 (map removed)"

    Flip

Wend

FreeBrush brush
End

Index