Recommended Posts

As you probably know, there is an effect called sun fog or area fog in the KotOR games. This gives model parts further away from the player a flat color overlay. But as you might have noticed, skybox models do not get that overlay even though they are the farthest away. So my question is now: Why?

 

I've been talking to Sithspecter and Fair Strides about this and here's Fair Strides answer:

 

 

 

Open the .are file in K-GFF (or the Toolset and go to the Module Properties from the View menu). There are several fields that are relevant here:

 

(I only list the Sun fields, but there are corresponding Moon fields that you need to make match the Sun ones for simplicity's sake)

 

SunFogOn = A 0 or 1 setting that determines if the Fog is even present.

SunFogNear = A float (decimal) value determining how near the player the fog is, so basically how far you can see before the fog is there.*

SunFogFar = How thick is the fog "circle"/"wall"?*

 

*: I don't know if these are in meters (which I believe they are) or percent (which wouldn't really make sense...), but that would be a simple amount of testing.

 

Interesting sidenote: You can change the fog's color through scripting. Sadly you can't turn it on or off through scripting, which is what I would have programmed in... :| :| :|

 

 

 

The problem is that I don't think that this is how it works or is at least incomplete in a way. And since there may be other people interested in this topic, I figured I'd create a topic for it :D

 

From what I could tell I think that there is no fog from where to player stands up to the distance specified in SunFogNear. Then there is probably a linear gradient and from SunFogFar on, the fog is fully opaque. And here's what makes me think that this is the case:

 

post-12766-0-81297800-1479715322_thumb.jpg

 

To explain the picture: What you see is the first Ravager module in TSL (851nih) with the vanilla fog settings. All I did was to add an additional backdrop model to the module. As you can see, there is a fog gradient for the metal structures in the foreground. Then there is the vanilla backdrop/skybox model which includes the star background, the sith fighters, the red lasers and the explosion. None of that model has any fog overlay. But my new model with the planet backdrop and the Sith warships on the sides appears completely grey, even though all parts of this model ar closer to the camera than the skybox model but farther away than the Sith fighters. So, if the fog was only determined by the distance to the player, then all of this should be visible just as the vanilla skybox.

 

My first guess was that some file specifies which models receive sun fog and which do not. But when I take my model and replace the vanilla skybox, it still appears completely grey due to the fog. So, I assume that something in the model file tells the game whether or not this model gets the fog overlay. The problem is that when I export the ascii-version of the vanilla model and recompile it with MDLOps, this vanilla model also turns completely grey. So I fear that this information is lost due to our available tools, but I was hoping that you know a solution to this problem.

 

For the time being, I edited the .are file. In vanilla, the values are SunFogNear = 0 and SunFogFar = 150. I changed SunFogFar to 5000 and the fog disappeared completely just as I would expect going with my understanding of the way sun fog is handled. This is also why I think that your description is incorrect as this change should have turned everything grey when applying your explanation. The other weird thing is that setting SunFogOn = 0 had absolutely no effect...

But I'd like to keep the vanilla fog anyway, so I'd rather figure out the model part instead^^

Share this post


Link to post
Share on other sites

For reference, here's what I have on the subject, from my probably-never-to-be-finished module editing tutorial. This was probably written in 2008, and may well be wrong.

 

 


MoonFogColor – Sets the colour of the fog at night.

MoonFogFar MoonFogFar and MoonFogNear set the amount of fog in the area at night, if you turn fog on. NB: These two settings work in different ways. MoonFogFar sets fog emanating from the edges of the area (or the room the player’s in?). The higher the setting, the further away the fog starts out; the lower the setting, the nearer the fog.

MoonFogNear  - MoonFogNear sets the amount of fog emanating from near or around the player. This is really good for making a really foggy area, but it can easily make everything in the area totally invisible.

MoonFogOn – Turns on/off (by setting to 1 or 0) fog at night; without this turned on, MoonFogFar/MoonFogNear will not take effect.

 

The other thing I've noticed is that, as far as I can tell, fog has no effect in the Steam version of the game. My guess is that if this is the case, it was disabled by Aspyr on the basis that fog is no longer needed from a performance perspective. If I'm right, though, it's annoying if you wanted to use it for ambience.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.