Realistic Fog

Blitz3D Forums/Blitz3D Beginners Area/Realistic Fog

Chad(Posted 2004) [#1]
I'm looking for a type of dense, eiry fog that you see like when your driving in the mornings and it's so dense you can't see past 5 meters, but so it's not to bad you can still get through a dense fog.

here's what I've got from a code archive and coded it a lil to my fitting, but still not exactly what I want.

myfogtex=CreateTexture(128,128,2 Or 48)
SetBuffer TextureBuffer(myfogtex)
LockBuffer()
For j=25 To 127
 For i=25 To 127
  trans=(j-48)*4
  If trans<0 Then trans=0
  If trans>255 Then trans=255
 WritePixelFast i,j, GetRGB(120,150,150) Or (trans Shl 24)
Next
Next
UnlockBuffer()
SetBuffer BackBuffer()

myfog=CreateCylinder(4,0,user)
RotateMesh myfog,0,45,0
EntityAlpha myfog,0.1
EntityFX myfog,1
EntityTexture myfog,myfogtex
ScaleEntity myfog,10,15,10
FlipMesh myfog
Dim myfogb(10)
For i=0 To 3
 myfogb(i)=CopyEntity(myfog,myfog)
 scale#=1+(.1*Float(i))
 ScaleEntity myfogb(i),scale#,scale#,scale#
 EntityAlpha myfogb(i),.3*i
 EntityParent myfogb(i),myfog
Next


Thanks,
Chad


clownhunter(Posted 2004) [#2]
it's [], not <>. Also, I have no clue how to help you with the code.


Chad(Posted 2004) [#3]
Oops, my bad, thanks Clown Hunter.