Afterburner shader fix - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 11-16-2019, 09:10 PM   #1
Clorydric
Junior Member
 
Join Date: Dec 2018
Location: Lëtzebuerg
Posts: 93
Default Afterburner shader fix

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...


v3 and higher, screenshot taken at twilight


F-14, with fix :


Missile exhaust FX :


Flares FX :



Mod released to https://www.digitalcombatsimulator.c...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)
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...2&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.
__________________
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 / Valve Index

Last edited by Clorydric; 05-22-2020 at 05:37 PM. Reason: spelling - note to myself : avoid posting anything past midnight.
Clorydric is offline   Reply With Quote
Old 11-22-2019, 01:22 PM   #2
ron533
Member
 
ron533's Avatar
 
Join Date: Oct 2005
Location: Netanya, IL
Posts: 409
Default

Quote:
Originally Posted by Clorydric View Post
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) :
Spoiler:


Mod released to https://www.digitalcombatsimulator.c...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

Last edited by ron533; 11-22-2019 at 02:04 PM.
ron533 is offline   Reply With Quote
Old 11-23-2019, 01:38 PM   #3
Blinde
Member
 
Blinde's Avatar
 
Join Date: Jun 2018
Location: Finland
Posts: 234
Default

Looks great, although that night is maybe a bit too blue/purpleish.
Blinde is offline   Reply With Quote
Old 11-23-2019, 05:24 PM   #4
Clorydric
Junior Member
 
Join Date: Dec 2018
Location: Lëtzebuerg
Posts: 93
Default

Quote:
Originally Posted by ron533 View Post
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.

Quote:
Originally Posted by Blinde View Post
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 / Valve Index
Clorydric is offline   Reply With Quote
Old 11-23-2019, 05:27 PM   #5
Mustang
Veteran
 
Mustang's Avatar
 
Join Date: Oct 2004
Location: Essex, UK
Posts: 9,232
Default

Quote:
Originally Posted by Blinde View Post
Looks great, although that night is maybe a bit too blue/purpleish.
Check this video at 1:15sec, it's not too far off

Mustang is offline   Reply With Quote
Old 11-23-2019, 09:05 PM   #6
Harker
DCS Ground Crew
 
Harker's Avatar
 
Join Date: Dec 2014
Location: France
Posts: 2,343
Default

Quote:
Originally Posted by ron533 View Post
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:

Code:
    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!
__________________
Z370 Aorus Gaming 7, i7-8700K, RTX2080Ti FTW3 Ultra, Corsair Vengeance 32GB DDR4, 960 Pro, 970 Evo Plus, WD Gold 6TB, Seasonic Prime Platinum|
F/A-18C, F-16C, JF-17, AV-8B, A-10C, M-2000C, F-14, BS2, UH-1H, P-51D, Sptifire, FC3

Last edited by Harker; 11-23-2019 at 09:07 PM.
Harker is offline   Reply With Quote
Old 11-24-2019, 01:37 PM   #7
Clorydric
Junior Member
 
Join Date: Dec 2018
Location: Lëtzebuerg
Posts: 93
Default

Quote:
Originally Posted by Harker View Post
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.

Quote:
Originally Posted by Harker View Post
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

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 / Valve Index
Clorydric is offline   Reply With Quote
Old 11-24-2019, 02:57 PM   #8
Harker
DCS Ground Crew
 
Harker's Avatar
 
Join Date: Dec 2014
Location: France
Posts: 2,343
Default

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...
__________________
Z370 Aorus Gaming 7, i7-8700K, RTX2080Ti FTW3 Ultra, Corsair Vengeance 32GB DDR4, 960 Pro, 970 Evo Plus, WD Gold 6TB, Seasonic Prime Platinum|
F/A-18C, F-16C, JF-17, AV-8B, A-10C, M-2000C, F-14, BS2, UH-1H, P-51D, Sptifire, FC3
Harker is offline   Reply With Quote
Old 11-24-2019, 09:06 PM   #9
Clorydric
Junior Member
 
Join Date: Dec 2018
Location: Lëtzebuerg
Posts: 93
Default

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 :
Spoiler:

Preview Su-27 (and other aircrafts) :
Spoiler:
__________________
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 / Valve Index
Clorydric is offline   Reply With Quote
Old 11-25-2019, 12:13 AM   #10
Harker
DCS Ground Crew
 
Harker's Avatar
 
Join Date: Dec 2014
Location: France
Posts: 2,343
Default

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!
Attached Thumbnails
Click image for larger version

Name:	Screen_191125_014618.png
Views:	258
Size:	1.48 MB
ID:	221701   Click image for larger version

Name:	Screen_191125_015612.png
Views:	244
Size:	464.4 KB
ID:	221702  
__________________
Z370 Aorus Gaming 7, i7-8700K, RTX2080Ti FTW3 Ultra, Corsair Vengeance 32GB DDR4, 960 Pro, 970 Evo Plus, WD Gold 6TB, Seasonic Prime Platinum|
F/A-18C, F-16C, JF-17, AV-8B, A-10C, M-2000C, F-14, BS2, UH-1H, P-51D, Sptifire, FC3
Harker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 05:32 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.