Special Aircraft Service

Please login or register.

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

Author Topic: WxTech's 4.12 Sun and Wind classfiles  (Read 8936 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6072
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #36 on: June 02, 2020, 06:08:43 PM »

I spent a few hours delving into the math that sets the vertical angle of the windsock as it varies with wind speed. I have to admit to confusion. Not having a proper Java development package, I put the various formulas into a spreadsheet. Some variables I don't understand at all well  odd results obtain. Changes I make do not result in predictable behaviour. I did get a somewhat crude result that sorta kinda works with my altered class.

I'll keep plugging some more. It would be nice if Western chimed in, so that I could more fully understand the methodology.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Vampire_pilot

  • member
  • Offline Offline
  • Posts: 8630
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #37 on: July 24, 2020, 12:58:04 AM »

Hey WxTech

Did you make any progress with this flag issue?
Logged

cbradbury

  • member
  • Offline Offline
  • Posts: 1067
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #38 on: July 24, 2020, 02:05:15 AM »

Hey WxTech

Did you make any progress with this flag issue?

And a sort of side issue - if possible. I use your wind classfile principally for one reason - the stupid bouncing on land/water interfaces. I consider correcting this more important and as a result I can put up with the flag/windsock problem.

My question is: is it possible to just have the land interface adjustment in the classfile whilst otherwise keeping the wind as it is so that the flags work?

BTW let me take this opportunity to thank you for the work you do. You tend to address things that other people don't even think about. A recent example for me was to use your invisible mesh trick to remove (visually, at least) an unwanted and annoying building on a map (BlackSea_NK) which caused a ctd in the mapbuilder so I could not correct it any other way.  Please keep up your work - it is much appreciated.
Logged

Kopfdorfer

  • member
  • Offline Offline
  • Posts: 2185
  • PULVERIZER
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #39 on: July 24, 2020, 08:16:32 AM »

Hey WX ,

This is truly a fascinating exploration to me ( absolute example of a non-modder mind for sure ).
You continue to explore facets that attempt to provide great depth to this old sim.
I have not downloaded this to check it out yet , but I had a thought that relates ( I think ) .

If you have already covered this I am a dolt and someone can erase this post ( made very much
on the spur of the momoent and after a hit of morning caffeine ).

Has your recent work taken into account , and/or is it possible , to work in some manner of distant reflection
of an aircraft at long distance in certain conditions ( sun angle, aircraft bearing ) that might give away an otherwise unnoticed target/ally by a reflection of light ?
Ideally of course this would also relate to the type of finish on the aircraft - unfinished metal/shiny surfaced camo/matte camo  - but I know that IL2 is unlikely to be able to reflect these differences.
Anyhow , I was just wondering whether you had pondered anything about this.

Keep up the interesting explorations.

Man I wish there was an HSFX8 in the works , I would lobby hard for the inclusion of this type of mod
to amp up the realism in the sim.

Cheers.

Kopfdorfer
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6072
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #40 on: July 24, 2020, 07:22:40 PM »

I've not progressed beyond my earlier sorta-kinda working windsock alteration. I'll release it as is, and you fellas can try it out. If not satisfactory, for those that want moving wind sock functionality I'll put out a basically stock wind.class that cures just the bump transitions when crossing coastlines.

As to the distant plane shine thing. If the aim is just to enhance the specularity at longest ranges only, my first approach would be to simply bump up the Specular value in the .mat file used for the farthest LOD. Going all the way to 1 might be good. SpecularPow could be set to 32, which gives a pretty tight confinement to the angular envelope over which the brightness enhancement is seen, and furthermore makes for higher brightness.maybe even 64 would be OK.

One potential problem here is the sometimes bizarre, vastly simplified model that comprises the most distant LOD. For instance, the wings could have a weirdly thick chord that results in steep leading and trailing upper surfaces. This would result in the specular highlights being seen from directions rather different to those expected for a normal wing construction.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6072
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #41 on: July 24, 2020, 09:23:32 PM »

I've just created a new topic in this Modworx forum, in which the WindsockGeneric.class for Western0221's Moving Windsock Mod has been altered to work with this Wind.class of mine.

In a nutshell, the original WindsockGeneric.class read the wind on the *surface*, where my new Wind.class has the speed reduced to zero. I raised the height at which the wind is taken to 30m, or the top of my near-surface zone of reduced speed. I also tweaked the response to speed, taking into account the change from the half-speed surface wind as previously used to full speed as used now.

Hopefully this will satisfy those who want a proper moving windsock again, while enjoying my other alterations and fixes to the turbulence more generally.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Mick

  • Modder
  • member
  • Offline Offline
  • Posts: 5517
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #42 on: July 25, 2020, 01:11:41 AM »

I've not progressed beyond my earlier sorta-kinda working windsock alteration. I'll release it as is, and you fellas can try it out. If not satisfactory, for those that want moving wind sock functionality I'll put out a basically stock wind.class that cures just the bump transitions when crossing coastlines.

As to the distant plane shine thing. If the aim is just to enhance the specularity at longest ranges only, my first approach would be to simply bump up the Specular value in the .mat file used for the farthest LOD. Going all the way to 1 might be good. SpecularPow could be set to 32, which gives a pretty tight confinement to the angular envelope over which the brightness enhancement is seen, and furthermore makes for higher brightness.maybe even 64 would be OK.

One potential problem here is the sometimes bizarre, vastly simplified model that comprises the most distant LOD. For instance, the wings could have a weirdly thick chord that results in steep leading and trailing upper surfaces. This would result in the specular highlights being seen from directions rather different to those expected for a normal wing construction.

I am not sure SpecularPow values above 4 are very recommended ...

This is what Vpmedia wrote about it (sorry can't find this post) ...

"Something is not ok in some of the mat files, for example if I put in the "OpelBlitz Maultier Rocket" into the FMB the fps drops from 75 to 34. When I switch to a stock vehicle the fps jumps back to 75.
Required adjustment: tfDoubleSide 1 to 0, tfShouldSort 1 to 0, tfMipMap 1 to 0.


I know if you change 1 to 0 the tfDoubleSide  on some modles you get that body without wheels or wheels without body disappearing look. 


  The best way to find such problems is Total Commander which can search for strings inside any file in a folder and output the results in a window from where you can drag all the files at once into a text editor. In the editor (I'm using Ultra Edit) you can use the Find/Replace function to replace "tfDoubleSide 1 to 0, tfShouldSort 1 to 0, tfMipMap 1 to 0" in every file with one click.

You can even go further and check your entire #SAS folder for errors like this.

Another common error is that the modders forget to turn on the specular lighting of the 3d model which results in flat appearance. In some cases they add too much specular lighting which results in textures "burning out" into 100% white color. In DirectX mode you only see the ambient and diffuse lighting, specular is not available.

Correct, stock values for 3d lighting parameters:

  Ambient 1.0
  Diffuse 1.0
  Specular 0.4*
  SpecularPow 4**

*can be as low as 0.1 or 0.2 for some 3d models, needs visual check / if this is 0 SpecularPow will not be used

**avoid using high values like 16 or 32"
Logged

cbradbury

  • member
  • Offline Offline
  • Posts: 1067
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #43 on: July 25, 2020, 02:45:50 AM »

A quick note for anyone wishing to use the wind classfile in BAT (the Sun class is already in BAT).

The classfile needs to be installed in the '!SAS_Engine_Mod' folder in each BAT module.
Logged

Vampire_pilot

  • member
  • Offline Offline
  • Posts: 8630
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #44 on: July 25, 2020, 03:07:12 AM »

This sounds great!
I will see that this is integrated into BAT's next patch. This is a nice improvement :)
Logged

cbradbury

  • member
  • Offline Offline
  • Posts: 1067
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #45 on: July 25, 2020, 03:13:46 AM »

This sounds great!
I will see that this is integrated into BAT's next patch. This is a nice improvement :)

Seems to work fine with the windsock mod, vampire - not noticed any problems so far. Finally - no more pole vaulting over riverbanks!
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6072
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #46 on: July 25, 2020, 07:03:38 AM »

Mick,
The admonition against a high value for SpecularPow applies more for a model seen close up, in some detail, where the highlights are often too tightly concentrated and make the coarsely made polygons on curved surfaces stand out as such. Lower SpecularPow diffuses the highlight more, making for the illusion of a more smooth curvature. I've not seen high values to impact frame rates to any perceptible degree.

Now, because of the extreme coarseness of the lowest LOD plane models (and that among planes there are rather different basic constructs), perhaps a lower SpecularPow value is advisable. Although it will make for both a weaker intensity Sun glint and a larger range of angle over which it is seen.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1537
Re: WxTech's 4.12 Sun and Wind classfiles
« Reply #47 on: July 26, 2020, 01:50:51 AM »

The specular lighting equation is pretty simple

Code: [Select]
specular = specular_amount * pow(saturate(dot(reflection, input.viewDirection)), specular_power);

So specular_amount (Specular in the material) affects the brightness of the specular effect.

specular_power (SpecularPow in the material) affects the angular range between surface normal and view direction that produces a specular hi-light.

Breaking the equation down

dot(reflection, input.viewDirection)

This is the cosine of the angle between the reflection ray and the view direction   (-1 to 1)

saturate  clamps the input between 0 and 1

pow raises the value to a power so pow(x,2) = x*x pow(x,3) = x*x*x and so on

Since the value you are using is between 0 and 1, the specular power is extremely powerful.

Value PowerResult
0.510.5
0.520.25
0.530.125
0.540.0625

You can see that once you get above about 4 the value of the equation starts to disappear fast.

I have seen specular powers of 50 set in some materials 

pow(0.9,50)  = 0.00515377520732011331036461129766     so even what you would expect to be a bright specular hi-light disappears to nothing.

Note as well that values less than one can be used, but that will make things very shiny

pow(0.1,0.1) = 0.79432823472428150206591828283639       

But due to the nature of the maths it is quite safe to do so, the result can never be greater than 1

Never ever use a specular power less than or equal to 0 though.   

Less than 0 is nasty and zero will always return 1

I hope this hasn't bored you ;D  I just want people to understand how it works so they can make informed decisions about which values to use rather than guessing and potentially having to do multiple tests before they are happy.






Logged
Pages: 1 2 3 [4]   Go Up
 

Page created in 0.034 seconds with 24 queries.