Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: New lens reflections  (Read 1407 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6031
New lens reflections
« on: November 30, 2023, 10:20:12 AM »

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/file

From 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

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Piotrek1

  • member
  • Offline Offline
  • Posts: 2381
    • SAS IL BYTES BACK
Re: New lens reflections
« Reply #1 on: November 30, 2023, 01:02:54 PM »

Thank you very much!
Logged

ssn637

  • member
  • Offline Offline
  • Posts: 176
  • Men mean more than guns in the rating of a ship
Re: New lens reflections
« Reply #2 on: November 30, 2023, 10:39:27 PM »

Wonderful to see those circles instead of the ugly polygons I'd suffered with before!  Thanks so much!
Logged

PO_MAK_249RIP

  • CMON U SPURS!
  • member
  • Offline Offline
  • Posts: 2093
Re: New lens reflections
« Reply #3 on: December 04, 2023, 01:03:44 AM »

Hi WxTech will all your recent effects upgrades be in your new effects pack release? If so I will wait till then
Great stuff btw
Mick
Logged
Corsair Carbide case, Intel core i5 4690 3.5ghz with Arctic Cooler, Asus Rock H97 performance, MSI Ventus XS OC 1660GTX 6GB DDR6, 32GB Patriot Viper 1600Mhz, 256GB/500GB Crucial SSDs, Windows 10 64bit.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6031
Re: New lens reflections
« Reply #4 on: December 27, 2023, 01:12:10 PM »

UPDATE: Dec 27, 2023: Complete replacement of my first release on Nov 30, 2023. Delete the older folder, and download the full archive again from the top post. I've made substantial code changes, affording much control of the appearance via conf.ini controls to add to the [Mods] section. Updated readme file contents also in the top post.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1]   Go Up
 

Page created in 0.042 seconds with 26 queries.