• ORBITER-FORUM will be temporarily closed at 2026-07-23 18:00 UTC while we complete some OF maintenance tasks. The amount of downtime is expected to take up to one hour, but probably less.

Beacon falloff and size settings

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,325
Reaction score
31
Points
123
Location
Sydney, Australia
I am adding some beacons to the Ananke tether and I am getting some unexpected results with the falloff and size settings of the BEACONLIGHTSPEC struct. Essentially the size of the beacon depends on the size value of falloff for any given camera (near) distance.

Some examples:

Code:
bs = new BEACONLIGHTSPEC;
bs->shape = BEACONSHAPE_COMPACT;
bs->falloff = 0;
bs->size = 0.1;
looks like:
attachment.php


Code:
bs->falloff = 0.5;
bs->size = 0.1;
looks like:
attachment.php


The API Reference says that falloff controls how the apparent size changes with distance. I assumed this to mean that at some distance (what value?) the beacon would be rendered at its true size and at greater distances it would shrink at a rate set by falloff. If I set falloff=1, the apparent size should stay the same however the beacon starts out very big and it gets smaller with distance, down to a very small size (couple of pixels) after which it stays constant.

Is this the correct behaviour? If not, any ideas what I may have done wrong?
 

Attachments

  • falloff0-0.png
    falloff0-0.png
    115.4 KB · Views: 90
  • falloff0-5.png
    falloff0-5.png
    132.4 KB · Views: 89
The falloff parameter kicks in only beyond a fixed threshold distance (currently hardcoded to 50m).
The algorithm for evaluating the true beacon size looks like this:
Code:
if dist > 50 then scale = (dist/50)^falloff
else scale 1
size = size*scale
So a falloff value of 0 keeps the true size constant (i.e. apparent size inversely proportional to distance) - no artificial magnification.
A falloff value of 1 scales up the true size beyond 50m to keep the apparent size constant.
I have attached a graph showing the apparent beacon size as a function of distance to demonstrate the effect.
 

Attachments

  • falloff.png
    falloff.png
    4.2 KB · Views: 28
Thanks Martin, I think I understand the problem now. I assume the "dist" you are referring to is the camera-to-vessel distance not the camera-to-beacon distance. The reason this makes a difference is that the vessel with the beacons on it is actually a 120km long momentum exchange tether and its centre of mass is some 90km away from the beacons. So, for the example above of falloff=0.5, although the camera is only some 40-50m away from the beacons the true beacon size would be:

Code:
size=size*(dist/50)^falloff
    =0.1*(90000/50)^0.5
    =4.2m
which looks about right, judging by the screenie.

I'll think on a work-around, but my first thought is to scale the beacons based on the camera-to-beacon distance determined by using oapiCameraGlobalPosition. Whether this is too expensive to do every time step or not will be a matter for experimentation. :cheers:
 
Back
Top