Blitz3D+ Command Reference

SkyBoxIntensity entity[,intensity#]

Parameters

entity - skybox entity returned by CreateSkyBox

intensity# - display brightness, 0 or higher; 1.0 (default)

Description

Sets how bright a skybox appears.

Dim the sky towards 0 for dusk and night scenes, or push it past 1 for a blown-out bright look. Fading intensity over time is an easy day-night cycle for the backdrop.

This changes only the visible background. Materials lit through BrushEnvironmentMap keep their own strength value, so dimming the sky does not dull reflections - adjust both when the whole mood should change. The entity must have been created with CreateSkyBox, and negative values are clamped to 0.

Requires Extended mode.

See also: CreateSkyBox, SkyBoxTexture, BrushEnvironmentMap.

Example

; SkyBoxIntensity Example
; -----------------------
; Requires Extended mode.

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

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

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

; Draw a tiny 2:1 equirectangular sky: gradient and sun
sky_texture=CreateTexture(128,64,1+8+32)
SetBuffer TextureBuffer(sky_texture)
For y=0 To 63
    Color 30+y*2,80+y,180+y
    Line 0,y,127,y
Next
Color 255,235,150
Oval 90,8,14,14,True
SetBuffer BackBuffer()

sky=CreateSkyBox(sky_texture)

; A ground slab for scale
ground=CreateCube()
ScaleEntity ground,4,0.1,4
PositionEntity ground,0,-1,2
EntityColor ground,60,110,50

intensity#=1.0

While Not KeyDown(1)

    ; Press [ / ] to dim or brighten the visible sky
    If KeyDown(26) And intensity>0 Then intensity=intensity-0.01
    If KeyDown(27) And intensity<2 Then intensity=intensity+0.01

    ; Set the skybox display brightness
    SkyBoxIntensity sky,intensity

    ; 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,"[ / ] : intensity   Arrow keys: move camera   Esc: exit"
    Text 0,20,"SkyBoxIntensity sky,"+intensity

    Flip

Wend

End

Index