UPDATE: Dec 27, 2023: Complete replacement of my first release on Nov 30, 2023. Delete the older folder, and download the full archive again. I've made substantial code changes, affording much control of the appearance via conf.ini controls to add to the [Mods] section. Read the updated readme file contents below.
===================== end of update ===================While this is technically an 'effect', I consider it more of a visual enhancement and so post this here.
Comparison, at the same 105 degree wide FoV, of the full sized, colorized pattern and the 0.3X sized, monochrome pattern. For the reduced pattern, zooming in will have it expand accordingly, and not spill outside the view to the degree it does for the 'normal' scaling.
Get it here:
https://www.mediafire.com/file/epxzyog2x8k13q0/%25210_LensReflections.7z/fileFrom the included
updated readme file:
New lens reflections, by WxTech
This mod concerns the representation of lens reflections when the Sun is within the field of view. It should work for all game versions to at least as early as 4.12, and probably earlier.
The old stock lens reflections from many years back used four textures of a pentagon, differing only in the degree of blurring applied to each. The pentagonal shape was obviously intended to represent a camera lens iris having just five blades. At some point a variation appeared where the textures were thin circular rings, with no blurring, and with three of them having a filled interior of lesser brightness.
I liked neither, and so elected to disable this effect a long time ago. (Conf.ini has a control for the purpose.)
Recently I decided to address this by making textures which are a little more suggestive of actual optical reflections. While at it, I looked at SunFlare.class, to see how these were generated on screen. And once the process was understood, of course I just had to make some little tweaks here, too.
Initially I only shifted slightly the position of a few, and adjusted the brightness and size of a handful.
But sometime later I got to thinking about deeper adjustments and incorporating player control. In the end I have added code to allow the player to adjust four elements via conf.ini controls:
1) Vary the brightness. This can range between the full stock brightness down to 10%.
2) Select the stock colorizing or make the reflections colorless. The colorless mode is to simulate lenses not having the kind of modern multicoatings that would reselt in the green and magenta tints that the stock scheme presents.
3) Display the lens flares when the viewpoint is inside the cockpit. The stock scheme renders these textures only from an external viewpoint. Interior rendering is at least useful for making guncam movies, or making other movies to suggest a cameraman inside the plane.
4) Adjust the size of the overall pattern. The current scaling has the farthest flare object just about in the opposite corner from the Sun at the widest FoV setting. At least, that's the case for my 105 degree default wide setting. It can be useful to shrink the pattern down to better fit within a narrower FoV, such as when making guncam or 'documentary' movies. The range can be from the full stock size (1X) down to 0.3X. I've found that for even my own 105 degree FoV that a scaling of 0.75X works well. Along with this overal pattern contraction, I also apply a concomitant shrinkage of the individual textures, albeit at about half the rate of pattern scaling.
Another innovation is the incorporation of a compensatory factor for the strong dimming of the textures when the Sun is lower in the sky. The stock scheme applies a marked and rapid dimming while the Sun is still fairly well above the horizon, and disappearance also when the Sun is not particularly close to the horizon. I retain good visibility until the Sun is getting rather nearer to the Horizon. This involves boosting the brightness, continuously via a power function, to as much as 8X at the point of disappearance.
I supply three versions of the four textures, archived in their own folders named [circular], [STOCK penta] and [WxTech]. The [WxTech] variations are set for use at installation. To use another set, copy the four .tga files in the relevant folder and paste them into the parent [SunFlare] folder.
To see these reflections, in the [game] section of conf.ini this line must be present:
NoLensFlare=0
If you use my effects mod, you could paste this [SunFlare] folder into my [Effects] folder (which contains the [SunGlare] folder, this being your sign of correct placement), and put the classfiles in the main effects folder (where the Explosions.class classfiles reside.) Otherwise make certain this folder resides higher in your listing than any other which contains shared files.
Copy the following 8 lines to the [Mods] section in conf.ini (and alter values to taste)
(The extra lines beginning with ";" characters are your guides, so you never forget what they do.)
==================================================================================================
;LensFlareBrightness=1.0 //0.1 to 1.0 (default if missing); controls brightness of lens flare
LensFlareBrightness=0.6
;LensFlareInside=0 //0=off (default if missing) or 1=on; enables drawing of lens flare inside the cockpit
LensFlareInside=0
;LensFlareScale=1.0 //1.0 (default if missing) to 0.3; controls size of overall pattern
LensFlareScale=0.75
;LensFlareColor=1 //0=monochrome, 1=color (default if missing)
LensFlareColor=1
SunFlare.class classfiles
=========================
896C0ABE2EB34D3A
BCAB94207382EE08
WxTech
Nov 30, 2023
Dec 27, 2023