scp-fs2open / scp-fs2open/fs2open.github.com

Current NanoVG implementation doesn't support filled concave paths

Open
#3,659 0 comments 0 reactions 0 assignees View on GitHub
enhancement graphics scripting
Dominant language
C++
Stars
487
Forks
184
Avg merge
3d 8h
Merged PRs (30d)
45

Description

NanoVG is used to draw many 2D shapes to the screen, including from the scripting graphics library.
While (as far as I can tell) there's currently nowhere in the code that tries to draw a concave path, this would be useful to let scripters draw arbitrary shapes to screen, which was a feature I was trying to add, but failed. If the paths are unfilled, they're drawn fine (ie, just the line strokes). If they are filled and convex, they're also drawn correctly. But if they're concave, nothing is drawn.

Upon some research, I found this:
https://github.com/memononen/nanovg/issues/461

According to the author, NanoVG needs to be drawn to a surface with a stencil buffer.

I tried looking into the code that initializes NanoVG and the drawing context, but I don't know enough to fix this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.