Special Aircraft Service

Please login or register.

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

Author Topic: My tweaks to Ar-196A-3 cockpit by Asura  (Read 2283 times)

0 Members and 2 Guests are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6035
My tweaks to Ar-196A-3 cockpit by Asura
« on: November 30, 2022, 04:03:02 AM »

UPDATE, A few hours after first release: I conquered the problem of incorporating a sluggish response in the magnetic compass, along with causing it to stop turning when bank or pitch exceed 45 degrees. Now the action of that compass looks nearer to real.





Get it here:

https://www.mediafire.com/file/rzvh1j1aevremg9/WxTech_Ar-196_cockpit_tweaks.7z/file


From the included readme file:


WxTech's tweaks for the Ar-196A-3 cockpit by Asura, available here:

  https://www.sas1946.com/main/index.php/topic,69845.0.html

This little mod includes only my changes, and so you must have the full cockpit already installed.

It would be best to copy/paste or drag/drop the files, especially as the main folder name is different.



My changes (perspex changes to both the pilot's and gunner's 'pit):
------------------------------------------------------------------

- Canopy perspex has the texture adjusted for less haziness and less dimming.

- Canopy perspex surface normals are reversed, to emphasize forward scatter.

- Canopy perspex has the specularity greatly reduced, so as to not create unrealistic reflection when the Sun is UNDER the plane.

- The gun sight is lowered by 5cm. I feel the former high position is extreme; to the point that the pilot might have to press his head against the upper canopy. And it was 'unfriendly' for lining up on without having to hit the 'gunsight view' key (grrrr).

- The gun sight's reflector plate has a new texture, with less haziness and specularity.

- The Sun shade glass has a new texture, for less milkiness and at the same time more dimming.

- The gun sight collimator lens has a new texture (the old texture was the practically invisible one for the reflector plate.)

- The reticle mask has been reduced a bit in diameter, to equal the collimating lens aperture.

- A reflection of the collimating lens is placed ahead of the reflector. It has a dynamically and differentially varying intensity based on the direction to the Sun (reflection is strongest when the Sun is directly above the plane.)

- I've replaced the reticle texture for one of higher resolution; this one also has longer extensions to the cross lines.

- Due to lowering the sight, I removed the power cable and plug. The socket is essentially now hidden anyway. And the cable and plug had areas of awful surface normals. And some 1,200 polygons are removed in the bargain!

- There was a complete duplicate of the housing for the Sun shade, and the lever that operates the raising/lowering. When raising the shade, this duplicated assembly rotated in a strange manner. And so I've disabled that redundant mesh.

- I added 6dof limits code to the cockpit class, resulting in a rather larger range of virtual head movement. Note that this is applicable for game versions 4.12 and later! The Java file is included.

- The view hooks have been moved a bit farther forward, and set at the same height (in line with the reticle in elevation.) The 'normal' hook is still laterally centered in the cockpit, but the combination of the lower sight and the expanded 6dof limits will make aligning with the sight much easier for head tracking gear--without having to hit the 'gunsight view' key.

- For the 'dirt' texture running along the perspex edges where they meet the canopy frame bars, I reduced the opacity and the specularity. Specularity is important to match to the value for the perspex, and so it should remain at 0.1. But opacity is much more open to taste. Originally it was at the maximum of 1.0 (now disabled with "//" characters), and I reduced to 0.5. If you prefer a more opaque dirtiness, more in line with the original appearance, open Pit3.mat (for both the cockpit and gunner 'pit) with Notepad and edit the ColorScale values from the current 0.5, as

  ColorScale 1.0 1.0 1.0 0.5  //1.0

to, say, 0.8, as

  ColorScale 1.0 1.0 1.0 0.8  //1.0

or whatever you prefer, up to the maximum of 1.0

- In the cockpit class, updated the magnetic compass code so that it ceases to turn when bank and pitch exceed 45 degrees. Moreover, a sluggishness in response has been incorporated, representing the inherent hysteresis in magnetic compasses.

- In the cockpit class, now disregard "zReViTinter" due to the mesh having been ignored in hier.him. This merely stops the reporting of a java error.



About the view hooks:
--------------------

In Body.msh (which you can view/edit with Notepad) we find the two view hooks, one for the 'normal' view position (CAMERA) and the other for the 'gunsight view' (CAMERAAIM). Here's how they appear now:

[Hooks]
 CAMERA <BASE>
 CAMERAAIM <BASE>

[HookLoc]   // each row is locator (matrix): axisX axisY axisZ translation.
// -4.37114e-008 1 0 -1.94707e-007 -8.51092e-015 -1 -1 -4.37114e-008 1.94707e-007 0.000602591 0.560972 0.575052  // hook #0, frm #0
// -4.37114e-008 1 0 -1.94707e-007 -8.51092e-015 -1 -1 -4.37114e-008 1.94707e-007 -0.0404342 0.371701 0.624025  // hook #1, frm #0
 0 1 0   0 0 -1   -1 0 0    0.0   0.35   0.58  //L B U
 0 1 0   0 0 -1   -1 0 0    -0.040   0.2   0.58

The original hooks are disabled with "//" characters preceding the lines of data. The "L B U" note indicates that the last three numbers, for the X, Y, and Z coordinates, when increased in value will move the hook Left, Back and Up, respectively. If you want to go back to the original fore/aft positions (recall that I've moved them both forward), use these lines, where the second to last numbers are what are changed:

 0 1 0   0 0 -1   -1 0 0    0.0   0.561   0.58  //L B U
 0 1 0   0 0 -1   -1 0 0    -0.040   0.372   0.58





WxTech,
Nov 30, 2022
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: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #1 on: November 30, 2022, 04:36:13 AM »

I didn't include this little adjustment, but perhaps I should have. It concerns the texture running around all perspex edges, where there is a quite dark shmutz suggestive of incomplete cleaning, and the pushing of dirt, etc. against the canopy frame bars. It's practically black, which I feel is exaggerated. More importantly, it has a high, mirror-like specularity, which should be reduced now that the perspex has had its specularity reduced.

Open Pit3.mat with your favorite text editor and make the two changes highlighted with arrows. The Specular value is reduced from 0.7 to 0.1 (greatly reducing the shiny reflection of the Sun at the appropriate illumination angle), and the opacity is reduced from 1.0 to 0.5 (making it appear more transparent).

Code: [Select]
[ClassInfo]
  ClassName TMaterial
[General]
  tfDoubleSide 0
  tfShouldSort 0
  tfDropShadow 0
  tfGameTimer 1
[LightParams]
  Ambient 0.7
  Diffuse 1.0
  Specular 0.1  //0.7  <------------------
  SpecularPow 16
  Shine 0.0
[Layer0]
  TextureName Pit3.tga
  PaletteName
  Frame 0.0
  VisibleDistanceNear 0.0
  VisibleDistanceFar 10000.0
  TextureCoordScale 0.0 0.0 1.0 1.0
  ColorScale 1.0 1.0 1.0 0.5  //1.0  <------------------
  tfWrapX 1
  tfWrapY 1
  tfMinLinear 1
  tfMagLinear 1
  tfMipMap 0
  tfBlend 1
  tfBlendAdd 0
  tfTestA 0
  tfTestZ 1
  tfUpDateClear 0
  tfModulate 1
  tfNoTexture 0
  tfAnimatePalette 0
  tfAnimateSkippedFrames 0
  tfCompressMajorAlpha 1
  tfNoCompress16Bit 1
  tfNoWriteZ 1
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: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #2 on: November 30, 2022, 04:52:31 AM »

I just updated the archive with the addition of the Pit3.mat files, and notes on making your own adjustment in the readme.
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: 5468
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #3 on: November 30, 2022, 05:00:05 AM »

... I believe Specular and SpecularPow are a "couple", and if Specular = 0.0, then you can put any value for SpecularPow, in fact it won't show because the Specular value is 0.0, which deactivates SpecularPow ...

Also, I remember reading (maybe by VPMedia) that SpecularPow should never exceed 4, so in your example if you set SpecularPow to 4 instead of 16, then you should get the same effect with Specular = 0.4 instead of 0.1 ...

Just my two cents ...  ;)
Logged

Kelso

  • member
  • Offline Offline
  • Posts: 490
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #4 on: November 30, 2022, 05:50:02 AM »

Thank you very much! As always, a first-class job.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #5 on: November 30, 2022, 06:30:44 AM »

... I believe Specular and SpecularPow are a "couple", and if Specular = 0.0, then you can put any value for SpecularPow, in fact it won't show because the Specular value is 0.0, which deactivates SpecularPow ...

Also, I remember reading (maybe by VPMedia) that SpecularPow should never exceed 4, so in your example if you set SpecularPow to 4 instead of 16, then you should get the same effect with Specular = 0.4 instead of 0.1 ...

Just my two cents ...  ;)

I'm quite aware of the specular 'duality' business. ;) Hence why I don't necessarily bother with setting SpecularPow to 0 if Specular is 0.

SpecularPow can certainly exceed 4; 16 definitely provides a more concentrated reflection than does 8, and in turn 4. A value of 32 is permissible, although it seems to offer limited or no further concentration than does 16.

I suspect that admonitions to not exceed 4 derive from the appearance on aircraft skins for most planes (particularly older) when the mesh is coarse and larger angular changes between large polygons results in the faceting really standing out. Larger SpecularPow is eminently useful for dense meshes having smoother curves/smaller facets. Such as some of the IES cockpits.
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: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #6 on: November 30, 2022, 06:44:05 AM »

I've created a new variable for magnetic azimuth (azimuthMag), so as to separate the action of this compass from the magnetic repeater (formerly both instruments used the same variable!) I've also added a check so that bank and pitch angles exceeding 45 degrees cause the magnetic compass to stop turning.

The remaining addition is the slowing of the response. At the moment, if the compass card stops turning for a while as heading changes, once freed up to turn again the card instantaneously snaps to the current heading. It should take a little while to slowly settle onto the current heading. Indeed, there should always be a lag, such that while turning the displayed heading will have not caught up to the actual heading. This is termed hysteresis.

I'm having trouble devising an expression to accomplish this, due to the way the azimuth is set. Here's the current code:

Code: [Select]
setNew.azimuthMag.setDeg(setOld.azimuthMag.getDeg(1.0F), ((FlightModelMain) (fm)).Or.azimut());
From another cockpit, here's an expression that induces hysteresis via a multiplication/division couplet of 35 and 36:

Code: [Select]
setNew.azimuthMag.setDeg((35.0F * setOld.azimuthMag.getDeg(1.0F) + fm.Or.getYaw()) / 36.0F);
I would like to incorporate a similar scheme, but the difference in the basic expression has me stumped; my attempts throw compiler errors. In this class's implementation, it's the "," that is giving me grief...
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: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #7 on: November 30, 2022, 07:44:26 AM »

UPDATE, A few hours after first release: I conquered the problem of incorporating a sluggish response in the magnetic compass, along with causing it to stop turning when bank or pitch exceed 45 degrees. Now the action of that compass looks nearer to real.

For those who are curious; from the cockpit class:

In method tick()
Code: [Select]
if (Math.abs(fm.Or.getKren()) < 45.0F && Math.abs(fm.Or.getTangage()) < 45.0F)
setNew.azimuthMag.setDeg(setOld.azimuthMag.getDeg(0.025F), ((FlightModelMain) (fm)).Or.azimut());

Formerly getDeg(0.025F) was getDeg(1.0F); the smaller value induces the sluggish response. Kren and Tangage are bank and pitch, respectively; when exceeding 45 degrees the compass card stops turning and the old azimuth value is 'frozen'. Once the card commences turning again, the lag in response causes it to slowly spin from the 'frozen' heading to the current heading.




In method reflectWorldToInstruments(float f)
Code: [Select]
super.mesh.chunkSetAngles("zCompas", setNew.azimuthMag.getDeg(0.025F), 0.0F, 0.0F);  //NEW, for magnetic azimuth

Formerly getDeg(0.025F) was getDeg(f). If a numeric value is used, it seems it should match that in method tick().
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: 5468
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #8 on: November 30, 2022, 07:52:54 AM »

... I believe Specular and SpecularPow are a "couple", and if Specular = 0.0, then you can put any value for SpecularPow, in fact it won't show because the Specular value is 0.0, which deactivates SpecularPow ...

Also, I remember reading (maybe by VPMedia) that SpecularPow should never exceed 4, so in your example if you set SpecularPow to 4 instead of 16, then you should get the same effect with Specular = 0.4 instead of 0.1 ...

Just my two cents ...  ;)

I'm quite aware of the specular 'duality' business. ;) Hence why I don't necessarily bother with setting SpecularPow to 0 if Specular is 0.

SpecularPow can certainly exceed 4; 16 definitely provides a more concentrated reflection than does 8, and in turn 4. A value of 32 is permissible, although it seems to offer limited or no further concentration than does 16.

I suspect that admonitions to not exceed 4 derive from the appearance on aircraft skins for most planes (particularly older) when the mesh is coarse and larger angular changes between large polygons results in the faceting really standing out. Larger SpecularPow is eminently useful for dense meshes having smoother curves/smaller facets. Such as some of the IES cockpits.

... yep, you're right, I read this a very long time ago, not even sure it was VPMedia who advised not to exceed the value of 4 ... ;)

Many THX for the explanation regarding the value of 16 ...  8)
Logged

gilles64

  • member
  • Offline Offline
  • Posts: 190
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #9 on: November 30, 2022, 10:04:12 AM »

 :) Thanks again for these improvements, great work as always WxTech. :)

Greetings,

Gilles
Logged

oldschoolie

  • member
  • Offline Offline
  • Posts: 422
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #10 on: July 22, 2023, 06:24:29 AM »

Link seems to be dead.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6035
Re: My tweaks to Ar-196A-3 cockpit by Asura
« Reply #11 on: July 23, 2023, 03:20:43 AM »

Link seems to be dead.

I just tried, and all is OK for me...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1] 2   Go Up
 

Page created in 0.05 seconds with 28 queries.