Jump to content

Afterburner shader fix


Clorydric

Recommended Posts

WARNING ! CRITICAL ISSUE ! 2020-05-22

PLEASE DO NOT USE THE F-14 FIX WITH THE LATEST OPEN BETA UPDATE (Supercarrier release, build 2.5.6.49314).

ANY EDITS TO THE "DCS WORLD\COREMODS" FOLDER WILL BREAK THE MODIFIED MODULE AND MAKE IT UNAVAILABLE.

 

Hi !

 

I'm trying to mod the afterburner FX to get it a bit more realistic... (actually, there was a commented line that's supposed to change AB colors, so I uncommented and modded it to react to sun brightness)

 

Current changes :

- Afterburner color now changes according to gSunAttenuation. You should have a more red/orange tone during day, and it will fade to white/light purple during night (like most night AB picture : flames are completely over-exposed and white balance is often messed up)

- Afterburner trail's opacity will also change according to gSunAttenuation. It will be almost invisible with a bright sunlight, and more opaque during night (again, over-exposition)

- Missiles and rockets exhausts color will change over time. Vanilla DCS color in daytime, more blue/purple at night. Same for flares (white balance thing).

 

Colors, opacity and fading will probably need a lot of tweaking to be right, your comments or advices are welcome !

 

Preview...

vkiJFMJ.jpg

 

v3 and higher, screenshot taken at twilight

KaJCTv3.png

 

F-14, with fix :

ILavjTL.png

 

Missile exhaust FX :

7Gpf91e.png

 

Flares FX :

cBFRD7B.png

 

 

Mod released to https://www.digitalcombatsimulator.com/fr/files/3307061/

 

 

WARNING - MULTIPLAYER ISSUES -------------------

While modifying *.fx files won't cause any issues with the IC (aka Integrity Check, kind of anti-cheat for multiplayer, enabled on some servers), any edits to *.hlsl files and afterburner.dds will and you'll be unable to join some servers.

If you want to play multiplayer, please choose the mod variant accordingly !

The F-14 fix will trigger an instant IC failure.

"afterburner.dds" (texture) mods will cause IC failure when you load a mission/access a server or when you try to respawn/restart a mission. Same issue for *.hlsl files (ie. Flare FX mod).

 

 

CHANGELOG -----------------

(previous changes in spoiler)

 

 

2019-11-17 : v1

- Initial release

 

2019-11-24 : v2

- AB trail color was slightly changed for night, should be a little more white

- Noticed some noise was ADDED to the opacity, hence the hard cut visible when you push AB to 100%. Used another way to add noise, so that the end of the trail will remain fully transparent.

As a side-effect, the trail may appear a little shorter. (Sorry, I REALLY can't do anything about that, it would break IC)

 

2019-11-25 : v3

- Changed variable used by heat blur effect. Should be less noisy when flying (but doesn't change the blur when you're on the ground).

Thanks Harker for the tip !

 

2019-12-04 : v4

- Added some variants.

 

2019-12-23 : v5

- Added missiles and rockets exhaust FX. (WIP)

 

2019-12-25 : v6

- Added F-14 AB fix.

SINGLE-PLAYER ONLY. THIS FILE CAUSE IC (integrity check) FAILURE IN MULTIPLAYER.

 

2019-12-26 : v7

- Added a variant "night only" per user request. Should be very similar to DCS unmodded fx for day, and var. 1 for night. (WIP)

 

2019-12-26 : v8

- Tweaked var. 4. : Day version is more visible.

 

2019-12-29 : v9

- Added new afterburner texture (higher res), FX slightly tweaked for this. (Variant 5)

This variants also change textures for F-16 and F-18. If you want to keep default textures for those, remove all "afterburner_f-1*C.dds" textures in "DCS World\Bazar\TempTextures\...".

SINGLE-PLAYER ONLY. THIS FILE CAUSE IC (integrity check) FAILURE IN MULTIPLAYER.

screenshots here

 

 

 

2019-12-30 : v10

- Added flares fx.

SINGLE-PLAYER ONLY. THIS FILE MAY CAUSE IC (integrity check) FAILURE IN MULTIPLAYER.

Moved missile/rocket exhaust fx to differents mod variant.

Moved new afterburner texture to "Bazar\TempTextures" and restored DCS default "Bazar\Effects\ParticleSystem2\afterburner.dds" (Don't worry, textures in "TempTexture" folder have priority over the other ones).

 

 

WARNING - DCSW UPDATE 2.5.6 :

Update 2.5.6 from 2020-02-14 changed the default afterburner FX. This mod NO LONGER WORKS IN 2.5.6.

An update is in progess, please check #32 : https://forums.eagle.ru/showpost.php?p=4214452&postcount=32

Unfortunately, I don't have access to my main computer ATM, so you'll have to wait for an update in the user files.


Edited by Clorydric
spelling - note to myself : avoid posting anything past midnight.

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Hi !

 

I'm trying to mod the afterburner FX to get it a bit more realistic... (actually, there was a commented line that's supposed to change AB colors, so I uncommented and modded it to react to sun brightness)

 

Current changes :

- Afterburner color now changes according to gSunAttenuation. You should have a more red/orange tone during day, and it will fade to bright purple during night.

- Afterburner trail's opacity will also change according to gSunAttenuation. It will be almost invisible with a bright sunlight, and more opaque during night (like over exposed pictures)

 

Colors, opacity and fading will probably need a lot of tweaking to be right, your comments or advices are welcome !

 

 

Night preview (no 3rd party effects used, of course) :

 

LjHK1vF.png

 

 

Mod released to https://www.digitalcombatsimulator.com/fr/files/3307061/

 

 

Doesn't seems to trigger an IC failure, so it should be safe for MP.

 

Thanks for your work!

Do you happen to know how to increase visibility distance of the afterburner?

since it disappears abruptly at a relatively very close distance.

it needs to gradually fade away at longer distances than it is now...

Cheers :thumbup:


Edited by ron533

Callsign   SETUP

Link to comment
Share on other sites

Thanks for your work!

Do you happen to know how to increase visibility distance of the afterburner?

Nope. I'll investigate, but it could be something else, ie. for performance reasons.

 

Looks great, although that night is maybe a bit too blue/purpleish.

Looks like the final color can be plane-dependant. It is much more blue with the hornet than FC3 aircrafts.

If you open the file with notepad++, around line 300, I've added some comments.

The color is set by the function lerp(float3(r,g,b),float3(r,g,b), vector)

You'll want to change the float3(r,g,b) having the higher blue (b) value. Remember that values are in range [0;1], so if you take colors from photoshop, you'll have to do value/255. If you use values like (0.7,0.6,0.9) it might do the trick.

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Do you happen to know how to increase visibility distance of the afterburner?

since it disappears abruptly at a relatively very close distance.

it needs to gradually fade away at longer distances than it is now...

AB length is controlled by the CoreMods\aircraft\<Module>\<Module>.lua. It works like that for most modules, but some, such as the F-14, use a different approach. For the F-18, for example, it is:

 

    engines_count    =    2,
   engines_nozzles = 
   {
       [1] = 
       {
           pos =     {-8.005,    -0.003,    -0.48},
           elevation    =    -1.5,
           diameter    =    0.765,
           exhaust_length_ab    =    4,
           exhaust_length_ab_K    =    0.707,
           smokiness_level     =     0.05, 
           afterburner_effect_texture = "afterburner_f-18c",
       }, -- end of [1]
       [2] = 
       {
           pos =     {-8.005,    -0.003,    0.48},
           elevation    =    -1.5,
           diameter    =    0.765,
           exhaust_length_ab    =    4,
           exhaust_length_ab_K    =    0.707,
           smokiness_level     =     0.05, 
           afterburner_effect_texture = "afterburner_f-18c",
       }, -- end of [2]
    }, -- end of engines_nozzles

You care about exhaust_length_ab and diameter. You need to adjust the diameter as well sometimes, because if you increase the length, the flame might clip outside the nozzles.

 

The other issue with the abrupt flame cut is not a fault of the mod, it's just the way the AB textures are made. For the F-18, they are located in CoreMods\aircraft\FA-18C\Textures\FA-18C.zip. You'll see that the flame still has that issue in the vanilla game, under certain viewing angles, but it's less visible because the flame is less visible at night. Make the flame brighter at night, the issue pops up. Maybe the OP can find a way to adjust the effect to make this less visible though.

 

 

In any event, it's a great mod, OP. Much appreciated!


Edited by Harker

The vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.

CVW-17_Profile_Background_VFA-34.png

F/A-18C, F-15E, AV-8B, F-16C, JF-17, A-10C/CII, M-2000C, F-14, AH-64D, BS2, UH-1H, P-51D, Sptifire, FC3
-
i9-13900K, 64GB @6400MHz RAM, 4090 Strix OC, Samsung 990 Pro

Link to comment
Share on other sites

AB length is controlled by the CoreMods\aircraft\<Module>\<Module>.lua. It works like that for most modules, but some, such as the F-14, use a different approach. For the F-18, for example, it is:

 

You care about exhaust_length_ab and diameter. You need to adjust the diameter as well sometimes, because if you increase the length, the flame might clip outside the nozzles.

Thanks for the tip ! However, I think modifying this lua causes IC issues.

 

The other issue with the abrupt flame cut is not a fault of the mod, it's just the way the AB textures are made. For the F-18, they are located in CoreMods\aircraft\FA-18C\Textures\FA-18C.zip. You'll see that the flame still has that issue in the vanilla game, under certain viewing angles, but it's less visible because the flame is less visible at night. Make the flame brighter at night, the issue pops up. Maybe the OP can find a way to adjust the effect to make this less visible though.

 

 

In any event, it's a great mod, OP. Much appreciated!

 

The issue is that the "end" of the afterburner texture is supposed to always be at 0% opacity. Increasing the overall opacity within the shader fx change this behavior, thus the afterburner become visible where the texture ends.

 

Either I should lower the AB opacity, or trying to find a way to make an opacity gradient...

The first one is somewhat easy (well, I restarted DCS around 40 times to get a +/- good result for the whole sunset/sundown, hence the "somewhat"), but I don't have any idea for the latter.

Editing the texture won't fix it as the transparency layer is already pitch black (0% opacity), and I'm far from being a code monkey :D

 

Pas de quoi' ;)

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Yeah, changing the main lua file does break IC, I forgot to mention that.

Ok, I see the problem with the opacity. Indeed, the only way around it seems to be an opacity gradient. But from what I could tell from the lua, any effect will apply to the whole texture. A challenge indeed...

The vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.

CVW-17_Profile_Background_VFA-34.png

F/A-18C, F-15E, AV-8B, F-16C, JF-17, A-10C/CII, M-2000C, F-14, AH-64D, BS2, UH-1H, P-51D, Sptifire, FC3
-
i9-13900K, 64GB @6400MHz RAM, 4090 Strix OC, Samsung 990 Pro

Link to comment
Share on other sites

UPDATED 2019-11-24 : v2

- AB trail color was slightly changed for night, should be a little more white.

- Noticed some noise was ADDED to the opacity, hence the hard cut visible when you push AB to 100%. Used another way to add noise, so that the end of the trail will remain fully transparent.

As a side-effect, the trail may appear a little shorter. (Modifying code to fix it would break IC)

However, you may get better results with another AB texture...

 

Preview F-18C :

 

HZv5LaF.png

 

Preview Su-27 (and other aircrafts) :

 

w7jbFgn.png

 

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

First of all, V2's AB color is amazing! Looks great on the F/A-18C Lot 20.

 

 

I realized that you probably have Heat Blur set of OFF on your PC, because with Heat Blur enabled, the added noise makes the AB effect very blurry, as shown in the first screenshot.

 

I dug around a bit and a way to get rid of it and keep Heat Blur enabled is to go to line 37 and change "static const int maxSegmentsHotAir = 8;" to "static const int maxSegmentsHotAir = 0;" or go to line 44 and change "static const float hotAirPower = 0.5;" to something like "static const float hotAirPower = 0.05;". The first change will completely remove the blur effect from the AB texture and the second change will simply reduce it. Then, it'll look like a steady flame, but it still blurs around the edges a bit, so it looks realistic, without looking very blurry. The end result is in the second screenshot.

 

I didn't test the other HotAir parameters, but for now, this works well for keeping heat blur enabled and having a correctly looking flame.

Apart from this minor change, the rest of the effect is excellent. Good job, man!

Screen_191125_014618.thumb.png.47751aa2181d075555f4c89c28f55675.png

Screen_191125_015612.thumb.png.ab70bb7df9d9f1c782710da6198fb054.png

The vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.

CVW-17_Profile_Background_VFA-34.png

F/A-18C, F-15E, AV-8B, F-16C, JF-17, A-10C/CII, M-2000C, F-14, AH-64D, BS2, UH-1H, P-51D, Sptifire, FC3
-
i9-13900K, 64GB @6400MHz RAM, 4090 Strix OC, Samsung 990 Pro

Link to comment
Share on other sites

Do you use an AB texture mod ? (ie. Werewolf's/Jokeract's mod)

I tested many planes yesterday and haven't noticed this issue with vanilla texture.

I'm thinking of this because the hornet uses a module-specific afterburner texture while most other planes use the default one.

 

edit : This is what I get with the default texture, heat blur enabled (AI aircraft, I don't own the M2kC):

 

HCBAKdO.png

 

The AB is slightly too large, but if you want to get if fixed, you may have to ask Razbam otherwise it will break IC (see #6 by Harker).

 

 

For the heat blur...

Sorry, can't reproduce this. Usually I fly with hb turned off (for VR perf reasons), and if I turn it on, I always get this, no matter the settings of maxSegmentsHotAir and hotAirPower. :

 

gwXPm5B.png

 

Testing with Su-27, 'coz I don't own the hornet neither. It gets better in flight, but on the ground it's really strange.


Edited by Clorydric

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Do you use an AB texture mod ? (ie. Werewolf's/Jokeract's mod)

I tested many planes yesterday and haven't noticed this issue with vanilla texture.

I'm thinking of this because the hornet uses a module-specific afterburner texture while most other planes use the default one.

No I'm not using any other AB mods. V1 worked just fine. Can I get that from somewhere so I can verify it?

Link to comment
Share on other sites

For the heat blur...

Sorry, I can't reproduce this. Usually I fly with hb turned off, and if I turn it on, I always get this, no matter the settings of maxSegmentsHotAir and hotAirPower.

That's normal, what you see here is the heat blur effect that's present at speeds below ~300 knots. That one not applied to the AB texture specifically, it's applied to the air that's located directly behind the turbines, it's just hot air distortion and it's normal.

To see what I'm talking about, fly at 350+ knots during total darkness, like 3AM on a moonless night (default date works fine). You'll see the AB blur with the default setting and stop blurring with maxSegmentsHotAir=0.

The vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.

CVW-17_Profile_Background_VFA-34.png

F/A-18C, F-15E, AV-8B, F-16C, JF-17, A-10C/CII, M-2000C, F-14, AH-64D, BS2, UH-1H, P-51D, Sptifire, FC3
-
i9-13900K, 64GB @6400MHz RAM, 4090 Strix OC, Samsung 990 Pro

Link to comment
Share on other sites

No I'm not using any other AB mods. V1 worked just fine. Can I get that from somewhere so I can verify it?

 

The default AB texture is in \DCSWorld\Bazar\Effects\ParticleSystem2\afterburner.dds

and should look like this :

5WHnc9W.png

 

 

 

afterburner fx v1 and original afterburner.dds in attachment

 

edit : v3 has been uploaded to User Files with Harker's changes. Thanks ! (hotAirPower = 0.05)

Also noticed the effect is absolutely UGLY with the AI viggen

 

 

Player :

XwlON1s.png

 

AI

ULPawVN.png

afterburner.zip


Edited by Clorydric

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

The default AB texture is in \DCSWorld\Bazar\Effects\ParticleSystem2\afterburner.dds

and should look like this :

5WHnc9W.png

 

 

 

afterburner fx v1 and original afterburner.dds in attachment

 

edit : v3 has been uploaded to User Files with Harker's changes. Thanks ! (hotAirPower = 0.05)

Also noticed the effect is absolutely UGLY with the AI viggen

 

 

Player :

XwlON1s.png

 

AI

ULPawVN.png

Thanks. Apparently V1 does now the same problem. Weird since I don't have any afterburner mods installed.

 

Hornet ja Viper apparently works properly and Tomcat since it uses different effect, all the rest has that same problem like that picture.


Edited by Blinde
Link to comment
Share on other sites

Thanks. Apparently V1 does now the same problem. Weird since I don't have any afterburner mods installed.

 

Hornet ja Viper apparently works properly and Tomcat since it uses different effect, all the rest has that same problem like that picture.

 

Do you also have this problem with AI aircrafts or only with player-controlled ?

 

Don't know if it will help, but... Have you tried to empty the "fxo" and "metashaders2" folders in your ...\Saved Games\DCS\ folder ?

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Do you also have this problem with AI aircrafts or only with player-controlled ?

 

Don't know if it will help, but... Have you tried to empty the "fxo" and "metashaders2" folders in your ...\Saved Games\DCS\ folder ?

AI aircrafts. Yes I tried deleting those and no help.

Link to comment
Share on other sites

check the alpha channel of the modded texture

I was thinking of this, but it seems he doesn't have any afterburner texture mod...

 

 

 

If you search for "afterburner" in your dcs folder, do you have dds files somewhere else ?

 

Maybe try a DCS repair ?

If the repair doesn't work, it could be an issue within the saved games folder.


Edited by Clorydric

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

I was thinking of this, but it seems he doesn't have any afterburner texture mod...

 

 

 

If you search for "afterburner" in your dcs folder, do you have dds files somewhere else ?

 

Maybe try a DCS repair ?

If the repair doesn't work, it could be an issue within the saved games folder.

Solved it, I didn't even thought that afterburner.dds could be somewhere else but after search I found it in TempTextures folder (what ever that even is). Deleted that and now it works. :doh:

 

Thank you so much!


Edited by Blinde
Link to comment
Share on other sites

  • 4 weeks later...

Little update : Missiles and rockets exhausts have been added to the mod. Mostly a color change ATM.

 

Also looking forward to add a flare effect to their exhaust (depending on gSunAttenuation), but it's harder than I expected...

 

 

AB FX :

- Added a fix for the F-14. The afterburner FX is now visible (diameter/length were 0.01/0.01 ; now 1.0/6.0), but this breaks IC.

 

Night :

ILavjTL.png

Day :

qFOm4ee.jpg


Edited by Clorydric

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

Is it possible to make a version, where the day a/b is the default DCS one, only the evening/night version is altered?

 

Exactly the same AB for day ? I'm not sure. Some functions were completely reworked and thus won't have the same behavior. I can (try to) make it pretty close.

 

> File updated in ED user files with a new variant (WIP, day similar to DCS vanilla fx/night is mod variant 1)....

The color change for day has been removed, but restoring DCS default opacity is pretty hard.

The hardest part is not to have a good "day" effect, and a good "night" one, but to have a realistic transition across the whole sunset/-rise...

 

Feedbacks welcome ;)


Edited by Clorydric

Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index

Link to comment
Share on other sites

new variant (WIP, day similar to DCS vanilla fx/night is mod variant 1)

 

Can't really see it in v4. Day (well, evening... aka caucasus 30 aug 18:40) version looks about the same as v1, night version looks even dimmer than in v1. I think I'm gonna stick with v1 for now.

 

Otherwise, awesome work!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...