Skip to content

Add support to render surface labels to custom cameras#669

Open
M3d1cZ4pp3r wants to merge 5 commits into
orbitersim:mainfrom
M3d1cZ4pp3r:custom-camera-labels-b
Open

Add support to render surface labels to custom cameras#669
M3d1cZ4pp3r wants to merge 5 commits into
orbitersim:mainfrom
M3d1cZ4pp3r:custom-camera-labels-b

Conversation

@M3d1cZ4pp3r

Copy link
Copy Markdown

This changes the Custom Camera render path to support rendering surface labels when a respective flag is set at camera creation.
Additionally, a scale can be set from the gcCore API. This is needed because we don't know how the target surface will be scaled on the actual screen later on, so the client of the custom camera needs to scale up the surface labels so they are readable.
The scale is applied to the symbols as well as on the fonts. For the fonts a cache of bigger fonts is created and used.
While there are other solutions that work and might take less resources, e.g. I did a small change to render the text to a sprite before rendering it to the sketchpad. This makes it sensitive to the sketchpads transform matrix and the font is upscaled too.

But this is a more invasive approach into the general text render path, while my requested approach only changes Custom Camera and Label Rendering logic, on the cost of keeping bigger fonts in memory and rendering them.

Additionally the Camera structures need to carry that scale information and also the dimensions of the render target.
This is because the projection logic of the Label Renderer needs to know the viewport dimensions.

In general I tried to minimize invasiveness and kept it backwards compatible, so no interface should break.

The reason for this change is that in the NASSP Apollo Project the superimposition technique on the optics sextant uses a custom camera. The user cannot spot landmarks then anymore. This allows to still render them, and resize them according to the size of the custom camera rendered texture on the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant