Blitz3D+ Command Reference

BrushShininess brush,shininess#

Parameters

brush - brush handle
shininess# - specular shininess, from 0.0 (matt, default) to 1.0 (shiny)

Description

Sets the specular shininess of a brush.

Shininess adds a bright highlight where a light reflects directly towards the camera - 0 gives a matt look, 1 a polished snooker-ball gleam. Because the highlight is calculated per vertex, it looks best on medium-to-high polygon geometry; a low-poly shape shows only a vague brightening.

It is the brush-level twin of EntityShininess: set it on the brush when shininess is part of a material you paint onto many things.

See also: EntityShininess, BrushColor, CreateBrush, PaintMesh.

Example

; BrushShininess Example
; ----------------------

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

camera=CreateCamera()

; Low ambient light makes the specular highlight stand out
AmbientLight 32,32,32

light=CreateLight()
RotateEntity light,45,45,0

; A red ball to paint. A brush is a 'paint recipe' applied with PaintEntity.
ball=CreateSphere(32)
PositionEntity ball,0,0,4

brush=CreateBrush(255,0,0)

shine#=0.5

While Not KeyDown(1)

    ; Press + / - to change the brush's shininess
    If KeyDown(13) And shine<1 Then shine=shine+0.01
    If KeyDown(12) And shine>0 Then shine=shine-0.01

    ; Set the brush shininess, then repaint the ball so the change shows
    BrushShininess brush,shine
    PaintEntity ball,brush

    TurnEntity ball,0,1,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

    Text 0,0,"+ / - : change shininess   Arrows: camera   Esc: exit"
    Text 0,20,"BrushShininess brush,"+shine

    Flip

Wend

End

Index