skybox and fog problem
Blitz3D Forums/Blitz3D Programming/skybox and fog problem
| ||
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? |
| ||
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. |
| ||
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? |
| ||
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..... |
| ||
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. |
| ||
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,0Just create the skybox, say, 5 units wide, and set it always be drawn first, using EntityOrder. |