Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Please login or register.

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

Author Topic: Would it be worthwhile to add a horizontal component to the guncam tracer mesh?  (Read 270 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6165

As you may know, the guncam tracer mod of many years back and since incorporated into B.A.T. uses an animated texel to cycle between a straight and a 'squiggly' tracer line. The squiggle is applied in the vertical only, and is better seen when the tracer is located out to the side, such as when emitting from wing guns, for instance. But if looking a tracer from above or below, such as for a gun firing from an underside fuselage gondola, the squiggle is not seen because the surface it is mapped to is in the plane of the viewpoint, meaning it is seen edge-on.

I was wondering if it might be worth the effort to add a horizontal component. Then there would be three aspects instead of two, with the cycling occurring between a straight line, a squiggly line in the vertical plane and a squiggly line in the horizontal plane. In this way the squiggle would be seen from all aspects except largely end-on.

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

shardana

  • member
  • Offline Offline
  • Posts: 876

Would that affect performance in the game. And to what extent?
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6165

I should think that in a busy scenario, such as AAA fire from a carrier group, the additional polygons conforming the 'straight' line texture to the squiggly texture would have some impact. Two such components instead of one would result in a near doubling of the polygon count in the mesh.

Now, we already have a means at hand by which to mitigate this. And that is the distance limits we can apply to the '3D' tracers via conf.ini entries, separately for the player, other aircraft, ground unit and Wirbelwind emitters.

A given field of view contains a volume of space we might simplify as a 'rectangular pyramid' whose apex is the viewpoint. (Our 'pyramid' has as a base a section of a sphere, but we can simplify to a flat base for the following.) If that volume were to contain a more or less uniform density of tracers out to the draw distance limit, the number to draw as we reduce that distance limit would decrease as the volume, NOT linearly as the distance, because volume is a cubic function.

For instance. One might first assume that halving the draw distance limit would halve the number to draw. But a moment's consideration of our pyramidal view volume will show the falsity of that assumption. If we slice off the bottom of a pyramid halfway between base and apex, we remove 7/8 of its volume. To remove half the volume we would slice away the lower 1/5. And so if the draw distance limit were to be 100m, lowering it to 80m would halve the number to draw.

Now, this is assuming uniform spatial density within the full volume set by the field of view. For wider FOVs this is increasingly unlikely, as the larger volume will tend to include clumpings of tracers within largely empty sky. And so on average the number of tracers to draw will halve when the draw distance limit is reduced to somewhere between 50% and 80% of the current limit. Perhaps we could use 2/3, or 66%.

I've also been pondering the use of LODs, with at least one additional, simpler mesh for the longer view distance. By way 9f example, the lightning bolt effect has 5 LODs, where the bolt thickness increases with each increase in view distance. A good part of my reasoning derives from the impact of FOV on tracer appearance. At wider FOVs the tracer can easily have a width of less than one pixel, which undersampling causes a jagged, 'shimmering' appearance. The transition from this overly thin representation to the simple but more definite 2D line is unsatisfactory. At more zoomed-in FOVs the reverse occurs, where the thick 3D line is suddenly replaced by a much less prominent thin line.

The use of LODs has the advantage of accounting for the apparent size of a mesh (the number of pixels it occupies) as the FOV varies. The draw distance of any particular LOD increases as the FOV decreases. Judicious setting of LOD values can ameliorate the current discontinuities just outlined.

In this way it could be possible to have the 3D tracer lines drawn to greater distance when zoomed in and thus showing fewer tracers in general. At wide FOVs the simpler mesh will be in effect at a fairly near distance limit.

In short, the current hard distance limit is not really suitable for varying FOV and differing screen resolution. If all players had the same screen resolution and were stuck with just one FOV setting, this would be perfectly fine. But a dynamically determined draw distance based on screen pixel count and FOV has decided advantages. Will this introduce a deleterious impact?

I think I'll work up a first test for just one tracer color, probably red, to get a feel for things...
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: 6165

I just made an extended mesh for the red guncam tracer in which an additional LOD having about 1/2 the polygon count has been appended. To make it more visible at the longer distance the line width has been increased (made fatter). I've set an LOD value which has the transition from the original, full mesh to the simpler mesh occur at a distance of roughly 150-400m, depending on the FOV (farther when more zoomed in) and for a 2560x1440 display.

Up to now I've had my player 3D tracer distance threshold set at 500m. I've just tried 1,000m, and I like the result! Before, while firing at a target the 3D tracer would wink out after about 2/3 second to a nearly invisible dot due to the 2D line being seen end-on. The transition was jarringly obvious. Now the tracer is more positively visible for a bit more than twice as long, and the transition to the 2D line is less abrupt. Really neat!

With the new tracer transitioning from 42 to 22 polygons at roughly 200m, this gives scope for extending the 3D tracer mesh visibility thresholds. The player tracers are the most important, of course, at least during play, and generally can be given the longest visibility threshold.  ;)  Doubling that threshold from 500m to 1,000m will incur practically no performance cost.

As to the other tracers (other planes, ground units and Wirbelwind), more consideration of the appearance as seen from a more side-on is warranted. This will inspire to not increase the distance threshold too boldly.

Anyway, things are looking good so far...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

shardana

  • member
  • Offline Offline
  • Posts: 876

Great!
Logged
Pages: [1]   Go Up
 

Page created in 0.039 seconds with 26 queries.