New answers tagged


This is due to depth testing. You need to order your sprite rendering back to front and either disable depth test or set it to gl.LEQUAL. Sprites will not render if the pixel depth is equal to a previously drawn sprite when the depth function is set to gl.LESS.


Unless you have a specific 256 colors palette in mind, you could just use the "8-bit truecolor" as described at 8-bit color Wikipedia page. To do that, you need to map R and G channels onto 8 values (3 bits each), and B onto 4 values (2 bits). Those 8 bits together make up 256 possible colors. Provided your gl_FragColor is already determined, the lines ...


opengl-tutorial has: a tutorial focused on energy bars OpenGL 3.3+ WTF licensed code that just works: Screenshot: ...


There are several ways to approach this problem. When it comes to WebGL performance the key is to: (a) reduce number of drawcalls, (b) reduce gpu overdraw (fill-rate) and vertices. (c) reduce buffer data transfers. Because you're filling the screen at most once and scene complexity is low, we can totally ignore (b). (c) is a bit more complex and I'll get ...

Top 50 recent answers are included