Might work for DBC.
Try using the mouse to move down slowly onto the landscape and watch as you enter the atmosphere daytime appearing.
` Fog test
` --------
` Setup
Sync On : Sync Rate 60
Set Display Mode 1440, 900, 32 : Hide Mouse
Backdrop On : Color Backdrop 0
Autocam Off : Set Camera Range 1, 0x7fffffff
` Create a matrix
Make Matrix 1, 10000, 10000, 50, 50
Randomize Matrix 1, 100
Update Matrix 1
` Texture
create bitmap 1,128,128 : set current bitmap 1
cls rgb(0,128,0)
for d=1 To 10000
ink rgb(0,rnd(255),rnd(50)),0
dot rnd(128),rnd(128)
next d
blur bitmap 1,4
get image 1,0,0,128,128
set current bitmap 0 : delete bitmap 1
prepare matrix texture 1, 1, 1, 1
` Camera
Position Camera 1000, 5000, 1000
` Skysphere
Make Object Sphere 1, -20000
Color Object 1, 0
Set Object Ambient 1, 0
` Texture
Create Bitmap 1, 1024, 1024 : Set Current Bitmap 1
Cls 0
Ink RGB(255, 255, 255), 0
For s = 1 to 2000
Dot Rnd(512), Rnd(512)
Next s
Get Image 2, 0, 0, 512, 512
Set Current Bitmap 0 : Delete Bitmap 1
Texture Object 1, 2
` Fog settings
MinHeight# = 0
MaxHeight# = 4500
MinFog# = 90000
MaxFog# = 40000
` Main Loop
Do
` Camera
Rotate Camera Camera Angle X() + MouseMoveY(), Camera Angle Y() + MouseMoveX(), 0
Move Camera 10 * ((MouseClick() = 1) - (MouseClick() = 2))
Position Object 1, Camera Position X(), Camera Position Y(), Camera Position Z()
` Get percentage along height
CamHeightPerC# = Camera Position Y() / (MaxHeight# - MinHeight#)
` Set new fog
FogDist# = (MinFog# - MaxFog#) * CamHeightPerC#
If (Camera Position Y() > MaxHeight#)
Fog Off
Else
Fog On
Fog Color RGB( 0, 128, 250 )
Fog Distance FogDist#
Endif
Text 10, 10, "Fog Distance " + Str$( FogDist# )
` Refresh
Sync
` Loop
Loop
Comments please
"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers