{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibhyiejmk4e37c672j6zd5roggkosgltqbq2lmni5s4hpdju4xmcq",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mgg5nmzeskr2"
},
"path": "/t/brillo-2-0-production-ready-2d-graphics/13747#post_15",
"publishedAt": "2026-03-06T18:09:34.000Z",
"site": "https://discourse.haskell.org",
"textContent": "Hi all, my first post/comment here. I’m learning Haskell, and for other reasons than graphics, but I have, in an earlier life, written an immediate mode OGL renderer, before converting it to OpenGL 3.2 or so.\n\nThe main idea is the number of draw calls must be minimized, and that there is a prioritized order of state updates. Data (vertices, colors, other data that can be used by shaders) stored in Vertex Buffer Objects is the cheapest to deal with, these are streamed across the other state (in the GPU). If you can rewrite stuff to instancing, even better.\n\nThen matrices, textures and at last shaders. Absolutely sort drawables by shader. An effect of this is that it is common to make shaders of maximum code size, such that they cover as many use cases as possible.\n\nThe basic premise for instancing is that if there are shapes that can be generated (by geometry/tesselation shaders) given just a few datapoints (e.g. position and orientation, texture coordinates, …), you can put out millions of things in a single draw call. I used this for map elements (lines for example).",
"title": "Brillo 2.0 - Production ready 2D graphics"
}