xavram
Community Member

Posts: 481
|
 |
« on: March 12, 2003, 05:31:03 PM » |
|
Why isn't this working? I'm using a mesh that acts like a skybox; in other words, its a large cube around the player that moves with the player and shows the sky in the distance. Why not just use the standard TV Skybox? Because I actually have 2 of these boxes and fade them in and out as I want to transition between one sky texture and another, like when you're moving from one region into another. Works very well but I'm having a problem with fogging.
In theory, I thought I could set my frustrum very high, render my skybox, then set the frustrum down to reasonable level to only include the stuff I want the player's vision to include. What's happening is, I'm losing my fog. If I keep the frustrum as a given amount, my fog shows up fine but setting the frustrum to always be at 10000 results in a massive drop in FPS and I don't want the players to be able to see the landscape that far away anyway. Here's the numbers I want.
Max viewing distance : 5000 Fog Minimum : 4000 Fog Maximum : 5000
This gives me the visual effect that I want but when I use the code like this...
Atmos.Fog_Enable False Scene.SetViewFrustrum 38, 10000 SkyBox(1).Render SkyBox(2).Render Scene.SetViewFrustrum 38, 5000 Atmos.Fog_Enable True Atmos.Atmosphere_Render
Code that renders the landscape and meshes
...I no longer see any fog. The skybox renders fine but the landscape is cut off my just an abrupt line, not the fogging effect that I want. If I modify the code like this...
Scene.SetViewFrustrum 38, 5000 ' This only gets called once
Atmos.Fog_Enable False SkyBox(1).Render SkyBox(2).Render Atmos.Fog_Enable True Atmos.Atmosphere_Render
Code that renders the landscape and meshes
...then I get the fogging effect I want but parts of my skybox are cut off. The skybox mesh is very large, about 10000x10000x10000. If I make it smaller, then it cuts into my viewing range of 5000, so that's no good.
Any suggestions would be, as always, appreciated.
|