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