-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HD OSD artefacts #21
Comments
The problem is that the OSD elements are loaded as one large texture and therefore the OpenGL option CLAMP_TO_EDGE cannot be set for each element. |
Using 512 separate texures is extremely unefficient. This problem can be fixed by adding 2-4px padding beetween characters. |
Ok. So I'm torn on this. I raised it but I'm the main person in the community that developed all the fonts. (AKA SNEAKY_FPV). I'm a perfectionist and seeing this stuck out like a sore thumb. If there's enough notice by other pilots I'll see if I can generate some font examples with the glyph padding. But if no one else is complaining/noticing this, then I'll leave sleeping dogs lie. |
Please do not regenerate fonts. Padding should be added programmatically while loading. Can be easily done, but this is not a high priority task for me. |
Normally you would use a TextureArray, but this can only be read in a shader, so no option here, unfortunately.
We have some elements that need to be displayed side by side without a pixel gap (e.g. numbers with decimal point), wouldn't we have a gap? |
Drawing side-by-side characters would be straightforward if the game operated solely in 1080p or 720p resolutions. However, since the window size can vary, scaling becomes an issue. To render such pairs correctly, the only reliable method is to place pre-defined pairs side by side on a texture, detect them, and then draw a single rectangle. This issue is distinct from the artifacts encountered when rendering individual characters. |
Automatic detection of the pairs (sometimes there are also several tiles, e.g. the INAV LOGO, or the crosshairs) is very time-consuming and must be specially predefined, as a custom font that has the graphics ‘in one piece’ would be simpler. I measured the performance compared to my old, first implementation with single textures: |
You cannot directly measure the impact because OpenGL calls enqueue drawing commands, which don't correlate with actual drawing time. However, I agree that with the power of modern PC GPU hardware, an additional ~100 batches per frame isn't significant enough to warrant optimization efforts. |
After a short dive into OpenGL, I think the best and solution would be to use ‘Modern OpenGL’, until now the plugin uses the outdated ‘fixed pipeline’. |
Small graphical artefacts are observed when HD OSD is overlaid. This occurs and is consistent no matter what font is selected for any HD system. An example is the top of the ENE directional arrow. Multiple other artefacts are observed at edges of certain elements that is unrelated to the source font image.
![image](https://private-user-images.githubusercontent.com/40166109/289326511-d421b800-7acf-4ab1-8918-a6a6219620e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODI3NjgsIm5iZiI6MTczOTU4MjQ2OCwicGF0aCI6Ii80MDE2NjEwOS8yODkzMjY1MTEtZDQyMWI4MDAtN2FjZi00YWIxLTg5MTgtYTZhNjIxOTYyMGU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAxMjEwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjZjQ2YjdlOWRiMmE0M2U0ZjFmZGVlYWQ1NjBjOGMzN2NmZWY2NDUzMWQ0NjQwMzU3OTM1ZDdjN2E0Mzg2YjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Wb6H8t8jCsWJq6_e1CedQZDNrn0alhKTWlcGRZPL3og)
The text was updated successfully, but these errors were encountered: