Hello,

okay, no problem. I am sure the code can be optimized.

But here are the first changings that I have made.

First you can make it fullscreen if you wish with:

In main.wdl under var v_DepotMore:

var video_mode = 9; (or 8) (I have a widescreen).
var video_screen = 1; (Full screen).

So you can see the effects better.

There are no changes in the shader.

Now open fog.wdl.

5: Line
Replace define mag_fog,100; into ...
define mag_fog, 10; (Donīt know if you really need it. I have tried some things)

44: Line

Replace wait(-5 + ....
with wait(-8 + ....

52: Line

Replace var fog_speed = 20;
If you wish.
If you do it, then the code is faster: Reduce it and try it.
I have also tried 1 instead of 20. But you must try this.

81: Line

Replace 5,8 with 2 (It will be faster with it) You have to try it.

88: Line

Replace my.Translucent (Lite-C syntax)
with my.transparent

Line 115:
And now the problem with the C-Script: It generates endless functions without changes and slows down until 3 fps or something like that.

First make a new variable under the line var fogcount.

Like: var max_fogus = 80; (The name is not important)

Replace the line:
while(fogcount > 0 || fogcount < max_fog)

with
while(fogcount < max_fogus)


I am sure, you can make the code better. I have tried it only a few minutes.

regards,

Logitek