How To Set Fog In Your Age

From OpenUru
Jump to: navigation, search

Partial credit go to Wodan944 from the GoW for the information about how to set fog in specific areas of your Age with Max.

When you've gotten your Age completed enough to export, convert it with Drizzle and link in to look, one of the things you may have noticed is that there is no fog. In many of Cyan's Ages we have fog that is different tints that we see.

The Fog Settings for your entire Age are controlled by a file that ends with .fni. It will have the same name as your .age file, so like for Neolbah the file's name is "Neolbah.fni"

When you export your Age from Max, there is no .fni file generated. This was something that was most likely controlled by the defunct "Age Manager" in Cyan's Plugin. Since we can't use that, Drizzle generates a "dummy" .fni file for us when we use it to convert our Age for use in Uru:CC.

However, the settings in this "Dummy" .fni file will not generate any fog.

There are two ways you can generate fog for your entire Age. One is by editing the .fni file, and the other way is with a python file in Max.

Editing The .fni File

If you want to edit your .fni file, you'll need to use a program like PlasmaShop or UruFun.

If I open up Neolbah's .fni file in PlasmaShop, this is what I will see:

Graphics.Renderer.SetYon 100000
Graphics.Renderer.Fog.SetDefLinear 0 0 0
Graphics.Renderer.Fog.SetDefColor 0 0 0
Graphics.Renderer.SetClearColor 0 0 0

So basically the fog is set to "nothing".

The first line: "Graphics.Renderer.SetYon 100000" is setting the distance for the fog. 100,000 is 100,000 feet. This is normally fine for any Age.

"Graphics.Renderer.Fog.SetDefLinear 0 0 0" is normally used to set your fog with "Linear" values. Some Ages will use "EXP" or "EXP2" here for Exponential settings.

"Graphics.Renderer.Fog.SetDefColor 0 0 0" is used to set the color of the fog, using RGB values (0 to 1).

"Graphics.Renderer.Fog.SetClearColor 0 0 0" is used to set the color on your screen if there is nothing to display (and if your made your Age correctly, there should ALWAYS be something to display!). The values are RGB (0 to 1)

If you were to open up say the .fni file for the City (Ae'gura), this is what you would see:

Graphics.Renderer.Setyon 100000 
Graphics.Renderer.Fog.SetDefLinear -1500 20000 1
Graphics.Renderer.Fog.SetDefColor .3 .2 .05
Graphics.Renderer.SetClearColor .3 .2 .05

So if you wanted your fog to be something like we see in Ae'gura, you could edit your Age's .fni file to what you see here.

If we open up say, Eder Delin's .fni file, this is what we would see:

Graphics.Renderer.Setyon 250
Graphics.Renderer.Fog.SetDefEXP2 250 1
Graphics.Renderer.Fog.SetDefColor .5 .35 .3
Graphics.Renderer.SetClearColor .5 .35 .3

As you can see, Eder Delin's fog settings are not "Linear", but instead are "Exponential". The color is also different.

So you can open up any of Uru's Age's that has fog that is close to what you want, and write them down. Then edit your Age's .fni file to have the same numbers. Then you can go link in and look. If you don't like it, you can keep editing the .fni file until you get what you want.

Using Max To Set Your Fog

In Max, with Cyan's Plugin, we have the ability to set the fog for a certain area of our Age. We can use this to set the fog for the WHOLE Age if you want to also.

What I'm going to show you is how to set it for a certain area of an Age. If you want to use this to simply set the fog for you ENTIRE Age, then all you have to do is make a Region Box that covers your entire Age.

Okay, here I have the tunnel in Neolbah. This is how it looks with NO fog set at all:


I want to have some bluish fog here. So first I make a region to cover this Area (Please note, if you are using this method to set fog for your whole Age, just make the box to cover ALL of your Age):


Using the Component Manager, I assign the PageInfo to it, and make it a Region Sensor. I also then assign a Python component to it. In the roll out, I use the dropdown menu box to select "xFogSet" python file.

The roll outs for the xFogSet python file will look like this:


I've picked "Linear" for the fog. The fog colors are RGB values and need to be separated by commas. Start and End distances are in Max units (or Feet). Please note, if you are using this to set the fog in your Entire Age, you may want to set the End distance to something large, like 100000.

I have the Density set to 1. Please do not leave it at 0 or you will NOT see any fog. The higher this number, the "thicker" your fog.

Once I export, convert and link in, here is what I see now when I enter the tunnel:


Something to keep in mind: if you are using this to set the fog in just a certain area of your Age, you will need to set the region up so that the player triggers it BEFORE they see it. Else the fog will suddenly pop into existance.

Return To: 3DS Max Plugin Tutorials

Copyright (C) 2011 Andy Legate.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".