Closed Jaffies closed 4 months ago
Here's a comparison:
Having this with a vb so polygons can be insanely fast would be phenomenal.
This request sounds like another workaround for the same issue, just like https://github.com/Facepunch/garrysmod-requests/issues/2394
The problem is that the only way you can cache polygons and draw some rounded shapes (roundedbox/circle) is to use textured polyfills, or use mesh generation and then drawing it by surface.DrawPoly(tab) or IMesh/mesh library. The problem is that if you cache IMesh, then it would work really fast, but it won't work with vgui library (it doesn't respond to vgui clipping nor vgui viewport manipulations. So you always need to make render.SetScissorRect() with absolute screen poses and draw meshes with panel:LocalToScreen(0, 0) as start coordinates, instead of 0, 0.
** surface.DrawPoly does work with vgui descently and it responds to viewport changes, unlike IMesh/mesh
If you would add Poly object which would work exactly like IMesh, but for surface.DrawPoly, then it will be really cheap to draw RoundedBoxes and make stencil work for them (for an example to make blur for them)