Attention all skinners!

Hi!
Sorry for abrupt disappearance. Got too busy with real life stuff. I was going to release the beta of new shaders earlier this week, but it seems they won't be ready even this weekend.

Yes, I think having both bump map and corrugation on the main texture may look weird, but I suppose you can't remove it on all existing skins anyway (I don't know how many are out there).
Once it works you will be able to try of course :)

I tried the texture by Pat Pattle and it really helped me to understand what I should work on.

I will let everyone know when I have more news.
 
We'll be using this thread for an open discussion of the Beta testing a few of us are involved in. It should be at least somewhat instructive for those of you who are not directly involved, so thanks in advance for being patient with us while we sort things out.
 
I thought the sun glare was a bit too overpowering, and seemed to be very sensitive to your viewing direction, so that with a slight turn of your head with TrackIR it would instantaneously flare up, or dim to nothing. I'm not sure it was the right place, but I went into Skybox.fx, and changed vs_glare from

Diffuse = In.Diffuse * (1.2 * vSunScreenPos.w * (1.0 - smoothstep(1.2, 1.5, max(abs(vSunScreenPos.x),abs(vSunScreenPos.y)))) * (tex2Dlod(Tex0, float4(0.5,0.5, 0, 0)).x));

to

Diffuse = In.Diffuse * (1.05 * vSunScreenPos.w * (1.0 - smoothstep(1.2, 1.5, max(abs(vSunScreenPos.x),abs(vSunScreenPos.y)))) * (tex2Dlod(Tex0, float4(0.5,0.5, 0, 0)).x));

and that seemed to settle things down.
 
What texture is used for the sun glare effect? That might have something to do with it. I like it a lot, though some times if you maneuver quickly and the sun move behind a panel or other cockpit structure, the glare will not fade out until it is appearing to come out of the middle of an area where it should be blocked.

Would it be possible to get a full features list so we know what to look for?

Bugs - some have been around a while, others new, just restating them since it's a new version:
-Bomb craters flicker
-models using textures with an alpha channel to hide certain parts have shadows cast on them by the invisible parts
-reflector sight bug as mentioned before (alt-tab did improve this)
-sometimes at low level I will see a small roundish shadow on the ground not associated with a cloud, or terrain or any models.
-reflections (I know these are known issues but just describing how they appear)
-normal reflective aircraft do seem to have the r.dds working, but it also appears to change the color of the main texture somewhat as if it was a semi-transparent layer.
-glass actually does use the environment effect, but only very faintly. It may actually be the fresnel effect applied to the glass and not actual reflection.

Self-lit textures:
Very nice! I was able to experiment with making my own and made some luminescent gauge markings.

Reflector sights:
After alt-tabbing out and then going back in, I was able to get a good look at them. I attempted to make a new one using a different reticle texture. The new texture was 512x512 and the lines of the reticle were about three or four pixels wide. The problem was that only the wider portions of the lines displayed all the time, with the rest only visible from certain angles.

Cockpit lighting:
I was confused by the notes in the ini file. The example didn't seem to use all the parameters. They do seem to work well though.

Fresnel effect:
I think this time you've got it pretty close, but it still makes the models look too wet or glossy. I think this may have to do with using the environment map. Perhaps if it used its own texture this could be improved. By way of explanation, specular effects look "dry" (as long as they aren't too sharp and intense) and the environment map makes a surface look "wet". I think the fresnel effect should be pretty dry, perhaps slightly wetter on reflective aircraft, but not much.

Specular effect:
Looks good, but seems more "wet" than previous versions and a bit overpowering. Also, is there a naming convention for adding specular and reflective maps for models that don't have them yet, or is this feature not enabled yet?

Bump maps:
Generally the bump effect looks better, but on models without an actual normal map, it still produces some odd effects. Is there still a way to turn it off for models that don't have a normal map and leave it enabled for those that do?

Props:
What is the purpose of the prop textures listed in the .ini file?
 
I have the moving reticle working now. It works well with TrackIR in that I have to recenter it much less often since you can now tell when your line of site is drifting off center. It allows you to keep aiming correctly even after you've done a lot of head turning and maneuvering in combat that would normally leave the TrackIR view and Gun Sight out of sync.

I did see some of the flashing on my Nvidia GTX670 with the latest 347.25 drivers, but it wasn't too bad. I eventually crashed into another plane and displaying those plane destruction effects triggered the screen to fill with errors (fragments of the HUD Gauge Textures everywhere) and the game crashed. Encountering the same conditions when I was flying a plane without the new reticle did not cause any problems.

My screen is 3840 x 1024, and I have always seen a white boundary line narrower than that when flying through the clouds. That seems to be resolved in this version. I do not see any effect from changing the values for FOV in the ini file.

I'm really liking how the cloud shadows look. I have them set at 10 for both Scale and Density. Wave Scale and Bump are both set to 5. Here's looking out the side window over the French Coast of the Channel.

attachment.php
 

Attachments

  • Cloud_Shadows.jpg
    Cloud_Shadows.jpg
    49.8 KB · Views: 20
More on the reflector sights. I made a new one, for the CR.42 and my experience with it has been different from the example Bf 109 one. I added the name of the CR.42's reticle texture to the .ini file, but it didn't disappear. So I hex edited it in the cockpit model to be invisible. Then my new reticle worked correctly. I scaled it to 2.0 to make it fit the glass, and found that it would disappear if I leaned too close in to it and reappear when I leaned back. I scaled it back to 1.0 and still had the same problem. Also of interest was that I have no graphical bugs whatsoever with my new reticle (other than disappearing when too close), while the Bf 109 still requires alt-tabbing one or more times to make it stable.
attachment.php
 

Attachments

  • Shot01-30-15-22-08-59.jpg
    Shot01-30-15-22-08-59.jpg
    27.2 KB · Views: 20
Hi! Great to see you've got it working!

MajorMagee, that line is the correct place to adjust sun glare strength.
My code doesn't load any special textures for sun glare, I think they are just the ones listed in <SunGlare ...> lines of suneffect.xml
There is also a couple of lines in vs_overlay shader in the same file:
Brightness = tex2Dlod(Tex0, float4(0.5, 0.5, 0, 0)).x
* 0.18 * vSunScreenPos.w * (1.0 - smoothstep(0.7,1.2, max(abs(vSunScreenPos.x),abs(vSunScreenPos.y))));
That 0.18 multiplier controls the darkening (larger value -> darker) of the screen when looking toward the sun.
I think it is realistic as is, but it is also possible to make the whole image brighter instead, similar to the stock white out effect:
Find these lines near the end of the file - inside pass BlendOverlay { ... } section:
BlendOp = RevSubtract;
SrcBlend = SrcAlpha;
DestBlend = One;
And change RevSubtract to Add. You may also need to increase the above mentioned multiplier to better see the effect.

It is possible to make the glare react quicker to sun visibility - right now it takes about 10 frames for the glare to disappear when the sun is occluded.
Line 116 (the end of ps_occlusion, just before vs_average):
return float4(lightAmount.xxx, 0.1);
Change 0.1 to higher value, 0.2 will make the reaction time 2 times faster (i.e. 5 frames).

I have always seen a white boundary line narrower than that when flying through the clouds. That seems to be resolved in this version.
Yes, this is one of small fixes that I forgot to mention. It was very annoying.

I have the moving reticle working now. It works well with TrackIR in that I have to recenter it much less often since you can now tell when your line of site is drifting off center. It allows you to keep aiming correctly even after you've done a lot of head turning and maneuvering in combat that would normally leave the TrackIR view and Gun Sight out of sync.
Yep, that's the point. I wonder what Microsoft was thinking back then when they added TrackIR support, but didn't implement correctly moving reticles.

Would it be possible to get a full features list so we know what to look for?
I haven't made such list yet, there are some minor tweaks, but unless you notice them naturally they don't worth mentioning.
Probably one interesting change is a fix to terrain bump mapping code. Previously it was causing ugly effects when standing on a run way with low sun - the width of bright and shadowed side of the runway unrealistically increased towards the end as if it wasn't flat, but pyramid shaped. This version should have it fixed, but as a side effect its likely decreased the overall strength of terrain bump mapping so I will have to retweak it.
Other that this I think you already found most of the main issues. So anything else will be a surprise to me as well

Very nice! I was able to experiment with making my own and made some luminescent gauge markings...
...Also, is there a naming convention for adding specular and reflective maps for models that don't have them yet, or is this feature not enabled yet?

The trick here is that besides the normal map which is always a standalone texture, all other "material" maps has to be merged into one texture by using different channels (RGBA).
The name should tell my code which channels are used for which purpose.
Available codes area:
+lrgb => colored light map, rgb channels.
+lr, +lg, +lb, +la => grayscale light map (i.e. just the brightness) in one of the channels, i.e. "+lr" is light map in red channel.
+sr, +sg, +sb, +sa => specular map in one of the channels.
+gr, +gg, +gb, +ga => glossiness map in one of the channels (black - "rough" surface, white - extremely sharp highlights)
So, if you want to have both specular and glossiness maps you need to name your texture like this: main_texture_name.+sr+gg.dds
This will tell my shaders to look for specular map in red channel and for glossiness map in green channel.

To reduce texture size for such maps you can save one or two channel textures using ATI1N (single channel) or ATI2N (two channel) compression using AMD Compressonator tool I mentioned before. This should provide better quality and smaller file size than standard DXT compression.
Note that if you use DXT compression color channels will interfere with each other because this compression works on the resulting color as a whole and not on separate channels.
Also note that normal and material maps doesn't have to be exactly the same size as the main texture. You can make them smaller if fine details are not needed.

Another feature of texture naming is # as wildcard character. You can name normal map spitfire_ix#_t.+nm.dds and it will match both "c" and "e" models.

- Bomb craters flicker
Try changing ZBiasFlatEffects. For WOFF we set it to 1.
By the way, I feel that ZBiasBitsResolution set to 15 is not correct since we are using high resolution z buffer (even if it is not selected in cfs3config, my shaders force it). I think it should be set to 23 or 24 .

- models using textures with an alpha channel to hide certain parts have shadows cast on them by the invisible parts
Yep, still need to look into it.

- reflector sight bug as mentioned before (alt-tab did improve this)
Investigating. Top priority.

- sometimes at low level I will see a small roundish shadow on the ground not associated with a cloud, or terrain or any models.
Yes, annoying issue. Can't find solution yet.

- normal reflective aircraft do seem to have the r.dds working, but it also appears to change the color of the main texture somewhat as if it was a semi-transparent layer.
Yes, haven't had time to make it look better, for now they behave as very reflective standard aircrafts.

- glass actually does use the environment effect, but only very faintly. It may actually be the fresnel effect applied to the glass and not actual reflection.
You are right. I still haven't managed to fix it properly. It is not too difficult, but this glass reflection really stands out from other cfs3 rendering features and I have to write some new code to properly support it.


Cockpit lighting:
I was confused by the notes in the ini file.

Yes, light settings doesn't work there yet.


but it still makes the models look too wet or glossy
Yes, want to tone it down. However, in WOFF most models are too dull that's why I have to increase the overall glossiness. Maybe I will add a parameter to configure this.


What is the purpose of the prop textures listed in the .ini file?
Simplified shader for better performance - no shadows, simplified lighting, etc. Current version also adds some shine to props, but it doesn't look good on some models so I will likely remove it.


I attempted to make a new one using a different reticle texture. The new texture was 512x512 and the lines of the reticle were about three or four pixels wide. The problem was that only the wider portions of the lines displayed all the time, with the rest only visible from certain angles.
Can you send me the file?
By the way, I want to add support for a special rendering technique allowing to make thin and smooth looking lines without using high resolution.


I added the name of the CR.42's reticle texture to the .ini file, but it didn't disappear. So I hex edited it in the cockpit model to be invisible. Then my new reticle worked correctly. I scaled it to 2.0 to make it fit the glass, and found that it would disappear if I leaned too close in to it and reappear when I leaned back.
Standard reticles should disappear if listed under [ReticleStatic] section and the sprite for dynamic one is present.
As for disappearing, hard to tell, need to reproduce the issue here, but I don't have this aircraft.

Is there still a way to turn it off for models that don't have a normal map and leave it enabled for those that do?
No, except that you may set BumpSmoothness to a large value in Models.fx to make it less noticeable. This setting doesn't affect normal maps.
I will add an option to turn off "automatic" bump maps completely - it will improve performance as well.

Phew. That's it I think
 
I looked in the shader code files for the place where you turn off the original reticles. I can find where you apply the dynamic reticles, but not the place where you access the TextureMagic.ini to get the list for exclusion and inclusion. Is it currently hard coded into the dll for the bf109g6? Perhaps that's why it didn't recognize that the Reticle_CR42.dds static one needed to be removed when Gecko tried to add it to the ini?

I applied the bf109g6 one to the P_47d and it worked as expected without needing to edit out the static one in the cockpit m3d file, but when I made a custom one for the L3 sight used in the P-47 it wouldn't work.

In any case the most difficult thing was to find the proper x,y, z location for positioning the dynamic reticle.
 
Last edited:
Great work guys! My PC is not really up to running the latest mods, there's quite an fps hit. (XP sp3 / 3.2 ghz / 3 gb ram / nvidia 8400gs)
However the tree and cloud shadows look brilliant.

Here's a couple of piccies showing my initial test on the bump mapping.

Before:
CFS3%20Tiger%20Moth%20bump%20map%20off_zpsi3ua7twc.jpg


With bump mapping on the fuel tank (top wing)

CFS3%20Tiger%20Moth%20bump%20map%20on_zpsxgrdqeaj.jpg



This is the map. It also makes the texture darker even if as in this the map only affects a couple of areas.
The effect is subtle, I'm going to play around with the texture more to see if I can get it more pronounced.

CFS3%20Tiger%20Moth%20bump%20map_zpsgxwhwolb.jpg
 
I've spent a bunch of time in trial and error trying to create another dynamic reticle. Everything works fine as long as I call the sprite texture reticle_bf109g6.dds. Any other name and it doesn't work. I've added the new file name to TextureMagic.ini every way I can think of, but nothing seems to make a difference in getting any file name other than reticle_bf109g6.dds to be recognized.
 
Pat Pattle,
If I understand correctly you filled unused parts with white color, but white isn't "neutral" color for normal map, it makes normals point to the side and that's why texture becomes darker -- it receives less lighting.
To make normals point up you should fill unused areas with RGB = ( 128, 128, 255 ) color which will look purplish.
It is also important to save texture in proper format - either uncompressed, DXT5 with red channel moved into alpha (same as for FSX), or ATI2N using compressonator tool.

Yes, new shaders are for more modern GPUs, while NVidia 8400 and similar will work they don't have enough power.
You can try reducing shadow quality in the d3d8.ini file - default settings are the maximum ones.

MajorMagee,
The texture has to be listed in effects.xml:
<bf_109g_6_gunsight ClassName="Shockwave" PullOnGround="0" CountCycles="1" Pulse="0" InitialDelay="0" Duration="99999" FadeInTime="0" FadeOutTime="0" Pause="0" PosX="0" PosY="0" PosZ="0" InitialSize=".00007" FinalSize=".00007" Texture="reticle_bf109g6.DDS" BlendMode="QuadSprite"/>
And then it has to be mentioned in TextureMagic.ini with a number for scale:
reticle_bf109g6.dds=1.0
(my example also has mysterious "|SDF" parameter, but it is ignored now).

Not sure what else might be wrong.
 
It turns out that the dds filename has to be in all lower case letters, and I had been using a few capitals. Go figure. With that small change everything is working now.
 
I looked in the shader code files for the place where you turn off the original reticles. I can find where you apply the dynamic reticles, but not the place where you access the TextureMagic.ini to get the list for exclusion and inclusion. Is it currently hard coded into the dll for the bf109g6? Perhaps that's why it didn't recognize that the Reticle_CR42.dds static one needed to be removed when Gecko tried to add it to the ini?
Shaders (as in .fx files) don't decide what to draw, just how to draw. The decision to hide the original reticle is made by the dll code, but it is based on the list of texture names mention in the ini.

I applied the bf109g6 one to the P_47d and it worked as expected without needing to edit out the static one in the cockpit m3d file, but when I made a custom one for the L3 sight used in the P-47 it wouldn't work.

In any case the most difficult thing was to find the proper x,y, z location for positioning the dynamic reticle.
Yes, positioning the reticle is difficult, I don't even know how to help with it.

Maybe some aircrafts have reticle modeled in a way that it is not recognized by my code. It is unlikely, but who knows.

One thing I forgot to mention. The moving reticle is activated only if it closer than 2 meters to the camera. I think it should be enough for any cockpit, but it is important to know.
I can set it to arbitrary value, this restriction is needed to avoid "detecting" reticles in another airplanes because xdp effects are shared by all crafts of the same model.

Added
It turns out that the dds filename has to be in all lower case letters, and I had been using a few capitals. Go figure. With that small change everything is working now.
Oh, it is a bug then. It was intended to be case insensitive, but looks like I did something wrong.
In my defense I want to say that I'm more used to modern programming languages where string manipulation is trivial, but when it comes to C++ you can do anything but working with strings is unusually complicated. That's why light settings in the ini file doesn't work as well - I could write a code to parse them in 5 minutes in C#, but in C++ it is a pain :)
 
I found that it would disappear if I leaned too close in to it and reappear when I leaned back. I scaled it back to 1.0 and still had the same problem. Also of interest was that I have no graphical bugs whatsoever with my new reticle (other than disappearing when too close), while the Bf 109 still requires alt-tabbing one or more times to make it stable.

I found that it is very sensitive to the Z position you assign for the effect. You can zoom in and out without a problem, but it you move closer with TrackIR you evidently get your eye point on the other side of the camera position and it disappears.

I've been trying to get the positioning correct for the P47D Razorback, and find that I can't get it to display on this side of the center post. It's probably some sort of z sorting sequence issue.

attachment.php
 

Attachments

  • P47D_L3_Sight.jpg
    P47D_L3_Sight.jpg
    110.7 KB · Views: 18
The problem with it not hiding the original reticle for the CR42 was probably related to the captial letters issue since the name is Reticle_CR42.dds

Gecko, can you try changing it to all lower case to see if that resolve the issue?
 
Yes, that did the trick. However, when I did, I began experiencing the unstable graphical issues associated with Bf 109 reflector sight.
 
I also just tried removing the moving reticle effect and just leaving the effect sprite in place. It also disappeared when I got too close, so I think this is actually a CFS3 bug as opposed to something wrong with the shaders code. I wonder if this can be fixed?

Edit - just had a look at the P-47 and had the same issue. I think it's a CFS3 limitation that always draws the cockpit in front of everything else. This is nice for keeping things like duplicate parts from the external model of the cockpit from showing and effects from a burning engine from instantly filling the cockpit (though it would be cool to have an in-cockpit fire start after a while, but that's beside the point.) Perhaps an exception could be made for gunsight reticles?
 
Last edited:
I will try to check if P47D issue is my bug, but even if not I might be able to work around it.

However the disappearing sprite issue when getting too close might be difficult to fix. I noticed that propeller disks often disappear in cockpit view in some aircrafts, maybe it is somehow related.
Can you try placing the sprite further away from the pilot? It doesn't have to be exactly where the real glass is, because reticle size doesn't depend on view distance and you can scale the sprite to be larger to match the glass.
 
Back
Top