This Could Be Very Interesting - AnKor's Shaders

Ankor,

Thank you for the advance notice on the new shaders. Sounds like it will allow us to add a few new animations at the very least.

Will fog and smoke effects look the same in front of external parts as they do vc parts?

Steve
 
Fog, smoke and rain is a problem I'm still thinking about.
There are some models which have VC parts placed as if they were external. For example Ground Crew's BF110 has gauges on engines.

Currently these outside parts appear through fog. My new code will allow to fog them properly.
However there's a reverse side of this: you wouldn't want to see smoke or rain inside closed cockpits, this could be especially bad for large bombers.

I think I will make cockpit obscure rain effect as it always did because there's nothing else I can do.
In-cloud fog overlay will likely go away and will be completely reworked.
However I haven't decided yet what to do with smoke from gunfire. My current idea is to do additional rendering pass for cockpit to get Z values of its opaque parts and cockpit glass (normally semi-transparent objects don't write Z values) and then use these values to block sprites. This adds some overhead, but it should be relatively small.
 
Here's an exciting new effect I sort of backed into this evening. :triumphant:

I always noticed that the fx_N_gtrail wing tip vortex effect looked okay from the outside, but from inside the cockpit, the alpha transparency wasn't working and you saw a solid stripe instead of a vapor trail.

After trying a number of fixes I discovered that referencing a different texture file resolved the issue. tr_condenstrail_basis2.dds that I provided with AnKor's Shaders was a perfect looking candidate, but when I tried it there seemed to be a new problem with it not always appearing when it should have. These effects have traditionally been implemented as speed dependent, but even expanding the speed range didn't fix the problem.

This evening it dawned on me that tr_condenstrail_basis2.dds was being suppressed because it was listed in texturemagic.ini as [HighAltSprite] and would only appear at high altitude like all good contrails should. So I created a copy of the file with a different name called tr_condenstrail_basis3.dds and then it would show up properly whenever the speed range requirement was being met.

That got me to thinking, that like contrails the wing tip vortex effect should really have been altitude dependent with it being limited to the thick humid air near the ground. AnKor's effect is set up so that the contrail effect becomes progressively more visible as you go above the threshold altitude, and then is 100% for everything above that. What I discovered just now was that you could trick it into doing the same thing to limit it to lower altitudes, getting progressively more visible as you descended, by adding this line to the [HighAltSprite] section of texturemagic.ini

tr_condenstrail_basis3.dds= 2500|-1500

This barely starts the effect at 8,200 ft, and it gets progressively more dense until it has 100% visibility below 3,300 ft.

I've seen exactly this effect on commercial airliners during the summer as we've made our landing approach. It's barely visible as you initially break below the cloud base, and gets brighter as you continue to descend, disappearing as the speed drops after touchdown.

With this ability you no longer have to restrict the gtrail effect to a narrow band of speeds to make it seem realistic. You could edit the aircraft xdp files to widen the speed range to cover more of the typical approach and landing speeds, and let the altitude control prevent it from showing up at combat altitudes.

Editing the altitude value ranges in the texturemagic.ini would be needed to adjust for winter versus summer humidity levels to be completely accurate, but that's not an absolute requirement to use this.

The entry in the effects.xml now looks like

<fx_N_gtrail ClassName="GroupEffect" Effect0="N_track_contrail_s"/>
<N_track_contrail_s ClassName="TrackEffect" FlatTrack="0" Lifetime="0" InitialDelay="0" ParticleLifetime="0.15" FadeInTime="0.02" FadeOutTime="0.12" PosX="0" PosY="0" PosZ="0" CountSegments="5" SegmentLength="2" Width="0.25" WidthGrow="1.2" InitialAlpha="0.00" InitialColor="250 250 255" Alpha="0.55" Color="250 250 255" FinalAlpha="0.00" FinalColor="250 250 255" BlendMode="QuadSprite" Texture="tr_condenstrail_basis3.dds" ZBias=".03"/>

versus the original

<fx_N_gtrail ClassName="GroupEffect" Effect0="N_track_contrail_s"/>
<N_track_contrail_s ClassName="TrackEffect" FlatTrack="0" Lifetime="0" InitialDelay="0" ParticleLifetime="0.15" FadeInTime="0.02" FadeOutTime="0.12" PosX="0" PosY="0" PosZ="0" CountSegments="5" SegmentLength="2" Width="0.1" WidthGrow="1.2" InitialAlpha=".00" InitialColor="250 250 255" Alpha=".55" Color="250 250 255" FinalAlpha=".00" FinalColor="250 250 255" BlendMode="QuadSprite" Texture="tr_smoke_6.dds" ZBias=".03"/>

*** Be careful not to end up with multiple copies of fx_N_gtrail as you edit effects.xml ***
 
Last edited:
Nice find! It is always interesting to see how people find unintended features in my code :)

Meanwhile I did some background work for DX11 shaders and found how cfs3 checks velocity limits for track effects. This allowed me to plug additional conditions into that code. So far this just means that I can define contrails by effect's name instead of texture name and can avoid emitting them at all instead of just hiding them at rendering level.
This could potentially allow more complex conditions for enabling/disabling effects, but I haven't thought about it much and not sure what is possible and what is not. Are there any interesting effects which require additional conditions?

Unfortunately keeping contrails when aircraft is out of view is still impossible.
 
Here's an exciting new effect I sort of backed into this evening. :triumphant:

You're a certifiable genius!

I've been going mad trying to figure out how to get my helo dust effect appear at the right altitude and speed. This solves it perfectly!

One minor thing: It is ineffective on airbases/land a couple hundred feet above sea level.

 
Great idea Andy, I'll have to add that to my next round of effects for the Spitfire project.

This could potentially allow more complex conditions for enabling/disabling effects, but I haven't thought about it much and not sure what is possible and what is not. Are there any interesting effects which require additional conditions?

Well that's got the wheels turning. Give me long enough and I could think up a whole bunch of things. Here's a few off the top of my head.

Horsepower - useful for engine exhaust effects. Manifold pressure could work too, but horsepower would be ideal. Would be good if it could be used in conjunction with the high altitude sprites so contrails can be shut off when the engine is shut down or destroyed.

G forces - G-force induced contrails (combined with Andy's low altitude sprite trick if possible), smoke from negative-g carburetor flooding that certain aircraft experienced (best if paired with horsepower for the same reason as the high altitude sprites).

Mach (as opposed to airspeed) - sonic booms, etc.

Altitude above ground - would be useful for dust effects as pictured above, would be good if it could differentiate between land and water to allow different effects. Think of flying at wave top height and kicking up a spray!

Rain - wet cockpit windows (that might be a long shot)

Rounds remaining in a given gun - could turn on tracers the last few rounds as was often done to let the pilot know he was almost out of ammo.

No idea how feasible any of that is, but a lot of those have been things we've beat our heads against for years.
 
You're a certifiable genius!

I've been going mad trying to figure out how to get my helo dust effect appear at the right altitude and speed. This solves it perfectly!

One minor thing: It is ineffective on airbases/land a couple hundred feet above sea level.


Now this is getting really cool!
 
................

Unfortunately keeping contrails when aircraft is out of view is still impossible.

Since after aircraft leave the scene, contrails tens to break up a bit and widen, could narrow bands of clouds be made to simulate that effect?
 
SweetFX versus Reshade

A couple of years ago I discovered that I needed to run SweetFX with AnKor's shaders for G-Sync to work in CFS3. I had tried to install the more up to date version called Reshade back then, but it wouldn't run at all so I reverted back to SweetFX for my 16 different installs. In most cases I didn't want/need any special effects so I created a null SweetFX profile that had everything turned off, and G-Sync would still be working fine.

When I recently installed MAW-43 I found that even before I got around to adding SweetFX to that install that G-Sync was working just fine. I'm not sure if it was an Nividia Driver Update, Windows 10 Update, or the newer d3d8.dll from AnKor that did the trick, but it was nice to know that I didn't need SweetFX any longer.

That prompted me to try the latest version of Reshade again, and sure enough, it was now mostly working okay (no DOF functions) with CFS3 (MAW-43 install). It warns you when you do the install that you will need an open source d3d8.dll that Reshade has as an optional add-on, but I just used the one already provided by AnKor and it ran fine. (I didn't want to risk losing all of our wonderful new functionality in CFS3 by using the generic file)

When I do have special effects turned on in-game I typically want to produce the same look that I get by post-processing a saved image in PhotoShop. My method is to do an Image-Adjustments-Auto Contrast, followed by an Unsharp Mask with settings of 20% strength, 30 pixel radius, Threshold 0 (High Local Contrast Enhancement). After trying a variety of shader filter and function combinations I finally hit on one that very closely matches what I get in Photoshop.

In SweetFX it's:
#define USE_LIFTGAMMAGAIN 1
#define RGB_Lift float3(0.82,0.82,0.82)
#define RGB_Gamma float3(1.075,1.075,1.125)
#define RGB_Gain float3(1.085,1.085,1.085)

In Reshade it's:
Effects=LiftGammaGain.fx
Techniques=LiftGammaGain
TechniqueSorting=LeiFx_Tech,AdaptiveFog,AdaptiveSharpen,AmbientLight,ASCII,BloomAndLensFlares,Border,Cartoon,Chromakey,CA,Clarity,ColorMatrix,Colourfulness,AdvancedCRT,Curves,Daltonize,Deband,KNearestNeighbors,NonLocalMeans,DepthHaze,DisplayDepth,RingDOF,MagicDOF,GP65CJ042DOF,MatsoDOF,MartyMcFlyDOF,DPX,EGAfilter,Emphasize,HDR,MotionBlur,FilmGrain,FilmGrain2,FilmicAnamorphSharpen,FilmicPass,Mode1,Mode2,Mode3,FXAA,GaussianBlur,GlitchB,HighPassSharp,HQ4X,Levels,LiftGammaGain,LightDoF_AutoFocus,LightDoF_Far,LightDoF_Near,LumaSharpen,LUT,MagicBloom,Monochrome,MultiLUT,MXAO,Nightvision,Nostalgia,PerfectPerspective,ChromaticAberration,ReflectiveBumpmapping,Tint,SMAA,SurfaceBlur,Technicolor,Technicolor2,TiltShift,Tonemap,UIMask_Top,UIMask_Bottom,Vibrance,Vignette


[LiftGammaGain.fx]
RGB_Lift=0.820000,0.820000,0.820000
RGB_Gamma=1.075000,1.075000,1.125000
RGB_Gain=1.085000,1.0850000,1.085000

The result is that the real time image gains clarity (a hint cooler, brighter and more contrast).

The only difference I see between SweetFX and Reshade using this profile so far is that Reshade drops about 3 FPS, while SweetFX has no slow down at all.

Reshade does provide more filters than SweetFX did, and is the basis for Nvidia's new FreeStyle Ansel features. However, some of the filters available in Reshade run quite a bit slower (-25FPS) on my system than the equivalent ones in SweetFX did, and combinations of even the ones that don't have much impact on FPS can quickly kill the performance. Having said that, the results can be amazing if you have the time to play with all the settings and options to create the look you want.
 
For bright and sunnier climates like MAW I find that in addition to the added clarity of LiftGammaGain I need to also brighten things up a bit, so I add in DPX as well.

The SweetFX DPX values I'm using are:
#define USE_DPX 1
#define Red 8.00
#define Green 8.00
#define Blue 8.00
#define ColorGamma 2.00
#define DPXSaturation 2.00
#define RedC 0.36
#define GreenC 0.36
#define BlueC 0.34
#define Blend 0.20

and in Reshade it's:
[DPX.fx]
Strength=0.200000
RGB_Curve=8.000000,8.000000,8.000000
RGB_C=0.360000,0.360000,0.340000
Contrast=0.010000
Saturation=2.000000
Colorfulness=2.000000

Top = Null, Middle = SweetFX Lift Gamma Gain, Bottom = SweetFX Lift Gamma Gain + DPX
kBLJROR.jpg


Again with SweetFX there is no FPS loss, but with Reshade LGG drops about 3 FPS and LGG+DPX drops about 9 FPS
 
Here are the AnKor compatible xpd effects entries for the ETO He219 aircraft:

<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_0_exh_r" />
<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_1_exh_l" />
<Effect Type="Track" EffectName="cockpit_light_uv" PosX="-0.475" PosZ="4.00" PosY="0.85" Pitch="110" Heading="20" MinVel="-999999" MaxVel="999999"/>
<Effect Type="Track" EffectName="cockpit_light_uv" PosX="0.475" PosZ="4.00" PosY="0.85" Pitch="110" Heading="-20" MinVel="-999999" MaxVel="999999"/>
 
One of the things I discovered about the SweetFX settings I posted above, that nicely enhance the daytime clarity, is that they make flying at night almost impossible. They push the darker shades all down toward black, and there are essentially no lighter tones to brighten, so there's nothing to see on the screen. :dizzy: At least it's easy to switch between presets.
 
You're a certifiable genius!

I've been going mad trying to figure out how to get my helo dust effect appear at the right altitude and speed. This solves it perfectly!

One minor thing: It is ineffective on airbases/land a couple hundred feet above sea level.


yum! would be great to see this applied on the BMW Flugelrad!
 
Here are the AnKor compatible xpd effects entries for the ETO Halifax aircraft

<Effect Type="Track" EffectName="cockpit_light_uv" PosX="-0.575" PosZ="4.25" PosY="1.05" Pitch="100" Heading="20" MinVel="-999999" MaxVel="999999"/>
<Effect Type="Track" EffectName="cockpit_light_uv" PosX="0.475" PosZ="6.25" PosY="0.75" Pitch="100" Heading="-20" MinVel="-999999" MaxVel="999999"/>

<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_0_exh_l" />
<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_1_exh_r" />
<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_2_exh_l" />
<Effect Type="Track" EffectName="fx_high_contrail" Location="emitter_engine_3_exh_r" />
 
I just had my first opportunity to use another feature that AnKor had mentioned in his original notes to us that was still untried at the time.

I was working on adding the same shading and reflective glass effects that I've completed for the outside view models, to the some of the interior cockpits. I had only done a couple and was getting a nice enhancement to the 3D look (example below), when I decided to see what it looked like at night. Everything looked fine until I turned on the UV lights to see the gauges. Talk about ugly!

At first I didn't understand what had gone wrong, but then I remembered the prohibition for having more than one helper texture assigned to a name. In order to get the shading on the cockpit surfaces I had created a new +sr file. Not a problem, until I also tried to access the +clight file too. (Normal maps are an exception to the one helper texture only rule.)

Fortunately, AnKor had provided a way out for me. I created an alpha layer in the +clight file that had the same +sr information in it, and then renamed it +clight+sa. Deleting the two other files, and Voila, problem resolved!

The only disappointment still remaining is that almost all of the original gauges we have were done as flat decals without lens glass, so there's no opportunity to provide them with dynamic shading and reflectance effects.

3o9Wyug.jpg
 
Last edited:
Well.....

Nearly all the planes that I have made have glass covering the gauge face in 3d. They all are textured using a "glass" texture and material. Just saying......
 
You can add this line to the effects section of the DR_MS406_AX675.XDP file to have the appropriate dynamic gunsight.

<Effect Type="Track" EffectName="FR_OPL_4_gunsight" PosX="0.000" PosZ="-1.066" PosY="1.22" Pitch="90" MinVel="-999999" MaxVel="999999"/>
 
Back
Top