I am trying to make a SceneView icon with text over it. I render the text separately over the icon. The icon however is faded in/out depending on the zoom on the icon. I want the text to fade in/out with it.
Does anybody know what the algorithm is to determine the alpha channels for the icon?
I concluded it is some ratio between the icon size (pixels) on screen and the width/height of the drawing SceneView.
Currently I simply compare the size of the icon on screen (pixel size) the to average SceneView dimensions ((width + height) * 0.5), and take 95% from that as the size at which it should be fully faded. That seems to work fine for square shaped SceneViews, as seen here:
However, as soon as the SceneView is shaped anything other than squared, there seems to appear an offset in the fading when doing it that way. The “less square” the shape is, the more obvious this offset seems to get:
If width or height alone don’t match, then have you considered diagonal size? Personally I would have guessed it was more about distance from the editor camera but that doesn’ apply to iso views.