Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's get somewhat tricky when you want things like gpu support, text rendering etc.

You have to do things like stencil texture to speed things up etc etc.



GPUs aren't really designed for 2D graphics out of the box. I've written about this before [0].

Text rendering can be tricky, but not that much trickier -- it's just the same curves at smaller scales.

Not sure what you mean by stencil textures. Are you talking about the NV_path_rendering approach where you stencil out the path? Yeah, that's not really a thing that people do these days.

[0] https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harde...


> it's just the same curves at smaller scales.

It's not that simple unfortunately. Hinting for TrueType fonts is a thing and without properly aligning resulting pixels at their own scale fonts tend to look very ugly when following pure curve definitions. Oversampling at e.g. 8x size is one possible option but then there are other problems that pop up once downscaling to display size.


Yeah I'm talking about that. What do people use then?


Fast, efficient 2D graphics using the PostScript (i.e. SVG) rendering model is still an open research problem. Most shipping implementations these days do full tessellation to triangles on CPU.


This is a beginner CS course, it's a lot simpler than that.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: