Brief history regarding the GMod backend renderer(in time order):
surface.* combined calls(in very early stage, the draw commands in core code is purely functions that consist of a series of calls to surface.*, which is not flexible and relies heavily on GMod surface lib. Also, it's not fast.)
- For the first time, draw commands in core code was changed to match those in Dear ImGui, though text rendering still relies on
surface.*. surface.DrawPoly() is used instead of other surface.DrawXXX(), despite the fact that it doesn't support per-vertex colors.
- Because of numerous inconveniences
surface.DrawPoly() introduced(it took me hours to debug certain weird visual glitches), I decided to turn to using mesh.* functions. It's still quite tricky at first to adapt the backend to use it(also, hours of debugging related to it), but it's what we have till now. But the unavoidable downside is that for every vertex, several mesh.* C function calls are needed. Note that every frame, a possible amount of thousands of mesh.* calls are invoked, including transitions between C and Lua?
Suggestions or ideas are highly welcomed here! I will also post about my progress, if I made any, related to this topic.
Brief history regarding the GMod backend renderer(in time order):
surface.*combined calls(in very early stage, the draw commands in core code is purely functions that consist of a series of calls tosurface.*, which is not flexible and relies heavily on GMod surface lib. Also, it's not fast.)surface.*.surface.DrawPoly()is used instead of othersurface.DrawXXX(), despite the fact that it doesn't support per-vertex colors.surface.DrawPoly()introduced(it took me hours to debug certain weird visual glitches), I decided to turn to usingmesh.*functions. It's still quite tricky at first to adapt the backend to use it(also, hours of debugging related to it), but it's what we have till now. But the unavoidable downside is that for every vertex, severalmesh.*C function calls are needed. Note that every frame, a possible amount of thousands ofmesh.*calls are invoked, including transitions between C and Lua?Suggestions or ideas are highly welcomed here! I will also post about my progress, if I made any, related to this topic.