Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Additional type of weather in QMB.  (Read 958 times)

0 Members and 1 Guest are viewing this topic.

Kelso

  • member
  • Online Online
  • Posts: 495
Additional type of weather in QMB.
« on: August 27, 2020, 12:15:55 PM »

Of the weather types available in QMB, I prefer to use 'clear'. It has a big drawback - a very visible line separating the texture of high clouds on the horizon. It is almost invisible in the 'hazy' variant, but I wish there were no 3d clouds in it. Is it possible to create an additional weather that will be a combination
'clear' (no 3d clouds) and hazy (hazy horizon)?





EDIT:
The case was provisionally settled. On the advice of Ranwers, I made the 3d clouds invisible with the alpha channel. The effect exceeded my expectations - I saw a completely new mood and weather in this old game. Personally, I am delighted. The problem of shadows cast by invisible 3D clouds remains to be solved. While in 'Poor' weather they are almost invisible, in 'Hazy' they are. Anyone know how to do this? I found in the unpacked files.sfs files:
CloBoard.mat
Cloud.mat
Cloud4x4.mat
Cloud4x4_nosort.mat
cloudata.cld
DATA.cld
but their content is a complete mystery to me.

As an encouragement, I enclose a few screenshots:











and modified cloud textures for those who want to test them at home.
https://www.mediafire.com/file/k0rgg3i1x22twkm/file

The 3d clouds will disappear in all types of weather, which is an inconvenience, but you just need to deactivate the mod to get them back.
Logged

Ranwers

  • SAS Team
  • member
  • Online Online
  • Posts: 1555
  • FiFi
Re: Additional type of weather in QMB.
« Reply #1 on: August 30, 2020, 01:30:05 AM »

Brilliant !
Logged
Remember, that it takes considerably longer to create a mod than a pretty screen shot

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #2 on: August 30, 2020, 12:42:49 PM »

Adding another weather type would involve changes to several classes. I do like the idea! But it would be involved.

It might be far easier to add to the clear weather the same hazing as present for Good or Hazy.

As for cloud shadow darkness, look at the CloudShadows.mat file in the MAPS/_Tex folder
 If not present, create one and add this:

Code: [Select]
[ClassInfo]
  ClassName TMaterial
[LightParams]
  Diffuse 0.75

;  Diffuse 0.2

The last line is another value in someone's mod. You can try values from 0 to 1 (or even higher?). I've long since forgotten in which way the changing values darken the shadows.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #3 on: August 30, 2020, 12:54:46 PM »

Here's where to define the haze by weather type. This is the createClouds() method in Mission.class:

Code: [Select]
    public static void createClouds(int i, float f)
    {
        if(i < 0)
            i = 0;
        if(i > 6)
            i = 6;
        if(cur() != null)
        {
            cur().curCloudsType = i;
            cur().curCloudsHeight = f;
        }
        if(!Config.isUSE_RENDER())
        {
            Main main = Main.cur();
            if(main.clouds != null)
                main.clouds.destroy();
            main.clouds = new EffClouds(World.cur().diffCur.NewCloudsRender, i, f);
            return;
        }
        Main3D main3d = Main3D.cur3D();
        Camera3D camera3d = (Camera3D)Actor.getByName("camera");
        if(main3d.clouds != null)
            main3d.clouds.destroy();
        main3d.clouds = new EffClouds(World.cur().diffCur.NewCloudsRender, i, f);
        if(i > 5)
            try
            {
                if(main3d.zip != null)
                    main3d.zip.destroy();
                main3d.zip = new Zip(f);
            }
            catch(Exception exception)
            {
                System.out.println("Zip load error: " + exception);
            }
        int j = 5 - i;
        if(i == 6)
            j = 1;
        if(j > 4)
            j = 4;
        RenderContext.cfgLandFogHaze.set(j);
        RenderContext.cfgLandFogHaze.apply();
        RenderContext.cfgLandFogHaze.reset();
        RenderContext.cfgLandFogLow.set(0);
        RenderContext.cfgLandFogLow.apply();
        RenderContext.cfgLandFogLow.reset();
        if(Actor.isValid(main3d.spritesFog))
            main3d.spritesFog.destroy();
        main3d.spritesFog = new SpritesFog(camera3d, 0.7F, 7000F, 7500F);
    }

It requires a simple adjustment to 2 variables for the Clear weather (cloud type 0) to assign FogHaze density and depth.

Now, this class *might* be touched by some other mod you already have. If so, that mod should incorporate such a change.

I'll look into cooking up a 4.12 version. If for no other reason than that I might very well like a little haze in my Clear weather!  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #4 on: August 30, 2020, 01:13:41 PM »

I use whistler's Mission Pro Combo mod, which alters Mission.class. Here's my quick attack on its createClouds() method, but yet to try out. I've deconstructed the formulae (blocked off with /*  */ characters bracketing the unwanted code) for the assignment of FogHaze and FogLow, and made simpler listings for easy changes for each and every of the 6 weather types (0 = clear to 6 = thunder) weather type.

Note that for FogHaze 4 is none, and 1 is the densest. For FogLow I *think* 4 is deepest and 1 is shallowest.

Code: [Select]
    public static void createClouds(int i, float f) {
if (i < 0)
    i = 0;
if (i > 6)
    i = 6;
if (cur() != null) {
    cur().curCloudsType = i;
    cur().curCloudsHeight = f;
}
if (!Config.isUSE_RENDER()) {
    Main main = Main.cur();
    if (main.clouds != null)
main.clouds.destroy();
    main.clouds
= new EffClouds(World.cur().diffCur.NewCloudsRender, i, f);
} else {
    Main3D main3d = Main3D.cur3D();
    Camera3D camera3d = (Camera3D) Actor.getByName("camera");
    if (main3d.clouds != null)
main3d.clouds.destroy();
    main3d.clouds
= new EffClouds(World.cur().diffCur.NewCloudsRender, i, f);
    if (i > 5) {
try {
    if (main3d.zip != null)
main3d.zip.destroy();
    main3d.zip = new Zip(f);
} catch (Exception exception) {
    System.out.println("Zip load error: " + exception);
}
    }
/*     int i_28_ = 5 - i;
    if (i == 6)
i_28_ = 1;
    if (i_28_ > 4)
i_28_ = 4; */

int i_28_ = i;
if (i == 0)
i_28_ = 3;  //was 4 = none
if (i == 1)
i_28_ = 3;  //was 4 = none
if (i == 2)
i_28_ = 3;
if (i == 3)
i_28_ = 2;
if (i == 4)
i_28_ = 0;
if (i == 5)
i_28_ = 1;
if (i == 6)
i_28_ = 1;

    RenderContext.cfgLandFogHaze.set(i_28_);
    RenderContext.cfgLandFogHaze.apply();
    RenderContext.cfgLandFogHaze.reset();
    RenderContext.cfgLandFogLow.set(0);
    RenderContext.cfgLandFogLow.apply();
    RenderContext.cfgLandFogLow.reset();
    if (Actor.isValid(main3d.spritesFog))
main3d.spritesFog.destroy();
    main3d.spritesFog
= new SpritesFog(camera3d, 0.7F, 7000.0F, 7500.0F);
}
    }
   
    public static void setCloudsType(int i) {
if (i < 0)
    i = 0;
if (i > 6)
    i = 6;
if (cur() != null)
    cur().curCloudsType = i;
if (Main.cur().clouds != null)
    Main.cur().clouds.setType(i);

/* int i_29_ = 5 - i;
if (i == 6)
    i_29_ = 1;
if (i_29_ > 4)
    i_29_ = 4; */

int i_29_ = i;
if (i == 0)
i_29_ = 3;  //was 4 = deepest?
if (i == 1)
i_29_ = 3;  //was 4 = deepest?
if (i == 2)
i_29_ = 3;
if (i == 3)
i_29_ = 2;
if (i == 4)
i_29_ = 0;
if (i == 5)
i_29_ = 1;
if (i == 6)
i_29_ = 1;

RenderContext.cfgLandFogHaze.set(i_29_);
RenderContext.cfgLandFogHaze.apply();
RenderContext.cfgLandFogHaze.reset();
RenderContext.cfgLandFogLow.set(0);
RenderContext.cfgLandFogLow.apply();
RenderContext.cfgLandFogLow.reset();
    }

I'll report back after a test...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Kelso

  • member
  • Online Online
  • Posts: 495
Re: Additional type of weather in QMB.
« Reply #5 on: August 30, 2020, 01:28:08 PM »

Many thanks for the advice.  Value
[LightParams]
  Diffuse 0.00

has eradicated the 3d cloud shadow completely  ;D.

As for the rest ... Unfortunately - class files are black magic to me.
I see you are running version 4.12. I feel that I will not experience the effects of your work - I am using 4.13.4  :(.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #6 on: August 30, 2020, 02:11:58 PM »

Kelso,
Is 4.13.4 moddable? If so any modder working with that version could incorporate the changes I've pointed out in just a few short minutes. Heck, it *might* be the case that the stock 4.12 Mission.class could be compatible with 4.13.4...

Here's the result of my test, again with 4.12.2's Mission.class for whistler's Mission Pro Combo mod, with my small alteration. Clear weather on the top, Good (or Hazy--they now look the same except for some difference in the arranging of the cumulus clouds) weather below. Same minimal atmospheric haze now.

This is the recent Green Hell map, plane near Lae, looking WNW along the N side of the Markham Valley. Note that I use Reshade, and employ just a single bloom effect which makes the distant hazing less blue and more naturally whitish. A far superior appearance compared to stock!

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #7 on: August 30, 2020, 02:21:29 PM »

Incidentally, Kelso, all those cloud related files in your first post concern the rendering of the cumulus clouds. DATA.cld is where you can make the cumulus clouds really big.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

David Prosser

  • member
  • Offline Offline
  • Posts: 3859
Re: Additional type of weather in QMB.
« Reply #8 on: September 03, 2020, 05:13:23 PM »

Got it working in BAT. I like it.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6050
Re: Additional type of weather in QMB.
« Reply #9 on: September 03, 2020, 05:34:15 PM »

David,
Not sure if you created the intended link to m4t?....

Did you make the changes to the class and upload it?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 24 queries.