Blitz3D+ Command Reference

BrushSheen brush,red#,green#,blue#,roughness#

Parameters

brush - brush handle

red#, green#, blue# - sheen colour from 0 to 255; black removes the layer

roughness# - sheen roughness from 0 to 1

Description

Adds a soft fabric sheen to a Standard material.

Cloth does not highlight like plastic: velvet, felt, satin and microfibre catch a soft glow at grazing angles instead of a sharp specular dot. This command adds that grazing-angle lobe on top of the base material - the go-to layer for curtains, sofas, character clothing and pool-table felt.

The colour tints the sheen (a deep red velvet often uses a lighter red sheen), and roughness spreads it wider. Setting the colour to black removes the layer. A new Standard brush starts with no sheen.

Imported glTF models with the KHR_materials_sheen extension arrive with this layer already set. Calling this command attaches the Standard material to the brush automatically.

Requires Extended mode.

See also: BrushClearcoat, BrushAnisotropy, BrushPBR, BrushStandard.

Example

; BrushSheen 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 matte purple sphere, like velvet cloth
brush=CreateStandardBrush(60,45,100)
BrushPBR brush,0,0.65
sphere=CreateSphere(32)

sheen_roughness#=0.4

While Not KeyDown(1)

    ; Press [ / ] to change the sheen roughness
    If KeyDown(26) And sheen_roughness>0 Then sheen_roughness=sheen_roughness-0.01
    If KeyDown(27) And sheen_roughness<1 Then sheen_roughness=sheen_roughness+0.01

    ; Add an orange fabric lobe at grazing angles and repaint
    BrushSheen brush,220,55,25,sheen_roughness
    PaintEntity sphere,brush

    ; Arrow keys move the camera - sheen shows at the silhouette
    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,"[ / ] : sheen roughness   Arrow keys: move camera   Esc: exit"
    Text 0,20,"BrushSheen brush,220,55,25,"+sheen_roughness

    Flip

Wend

FreeBrush brush
End

Index