skybox and fog problem

Blitz3D Forums/Blitz3D Programming/skybox and fog problem

ryan scott(Posted 2004) [#1]
if i turn on fog, i cannot see my skybox.

i did set entityfx on the skybox to be Full Bright, so i should be able to see it.

if i uncomment these, and generate fog
;CameraFogMode camera,1
;CameraFogRange camera,150,250


and i use this to create the skybox

SkyBoxID = CreateCube() ;(camera)
ScaleMesh SkyBoxID,1000,1000,1000
FlipMesh SkyBoxID
EntityOrder SkyBoxID,1000
t=LoadTexture("gfx\sky1.jpg")
EntityTexture SkyBoxID,t
EntityFX SkyBoxID,1
PositionEntity SkyBoxID,0,0,0,1
ShowEntity SkyBoxID

the skybox is not there, fogged out to black.

if i turn off the fog, the box appears again.

this seems strange to me...

is it something i'm doing wrong?


xmlspy(Posted 2004) [#2]
I think that you need a bigger fog range. Or how about making the skybox smaller, to keep the fog range as you have it, and position the skybox depending where the player or camera x,y,z position is.


ryan scott(Posted 2004) [#3]
i am having trouble with this still.

should i keep my skybox always with my player or camera in the center?

i am trying to do this but it keeps moving out of the box.

i am not sure why i need to move anything, because i did skyboxid=createcube(camera)

which should make skyboxid a child of camera... so if i move camera, skybox should move too. it doesn't seem to. it looks pretty weird.

is there a skybox example somewhere?


Genexi2(Posted 2004) [#4]
Throw this into yer code

EntityFX SkyboxID,9


That'll disable any lights affecting the skybox (flag 1), and fog (flag 8)

Anyway, as for movin the skybox, just set its EntityX\Y\Z to the target object....

If you want a great example on this, check out the Castle Demo if you got it, should be under "B3d\Samples\Blitz 3d Samples\mak\castle" in the blitz directory....I'm unsure if that was includin when Blitz3d itself was offered only in a download format, whereas it used to be physical, on a CD, with craploads of stuff.....


napole0n(Posted 2004) [#5]
The castle Demo still comes with both the downloadable demo and full versions of Blitz. It's probably the best demo of the bunch. While it doesn't look very hot, there's a lot of usuable techniques in it.


GfK(Posted 2004) [#6]
Your skybox is 1000 units wide, and you're setting the maximum fog range to 250. Therefore it stands to reason that anything beyond 250 units away from the camera will be totally fogged out/invisible.

The sykbox should always be parented to the camera, and reset the orientation of the skybox each refresh, i.e.:
RotateEntity SkyBox,0,0,0
Just create the skybox, say, 5 units wide, and set it always be drawn first, using EntityOrder.