Blitz3D+ Command Reference

CreateStandardBrush ( [red#][,green#][,blue#] )

Parameters

red#, green#, blue# (optional) - initial base colour components from 0 to 255; 255,255,255 (default)

Description

Creates a brush that uses the modern Standard material.

This is CreateBrush plus BrushStandard in one call: an ordinary Blitz brush with physically based lighting already attached. All the familiar brush commands keep working - BrushColor, BrushAlpha, PaintEntity and PaintSurface - alongside the Standard map, factor and layer commands.

A new Standard brush starts at metallic 1, roughness 1 (the glTF default), so BrushPBR is normally your very next call. Free the brush with FreeBrush when you are done with it - entities painted from it keep their material.

For the full story, see the Standard material in the shader guide.

Requires Extended mode.

See also: BrushStandard, BrushPBR, CreateBrush, PaintEntity, FreeBrush.

Example

; CreateStandardBrush 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

; A classic brush for comparison
classic=CreateBrush(80,170,255)

; The same colour as a Standard physically based brush
standard=CreateStandardBrush(80,170,255)
BrushPBR standard,0,0.35

left=CreateSphere(32)
PositionEntity left,-1.3,0,0
PaintEntity left,classic

right=CreateSphere(32)
PositionEntity right,1.3,0,0
PaintEntity right,standard

; Painted surfaces keep the brush state, so free the brushes now
FreeBrush classic
FreeBrush standard

While Not KeyDown(1)

    TurnEntity left,0,0.4,0
    TurnEntity right,0,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,"Arrow keys: move camera   Esc: exit"
    Text 0,20,"Left: CreateBrush (classic)   Right: CreateStandardBrush(80,170,255)"

    Flip

Wend

End

Index