New answers tagged

1

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.


1

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 ...


0

opengl-tutorial has: a tutorial http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/ focused on energy bars OpenGL 3.3+ WTF licensed code that just works: https://github.com/opengl-tutorials/ogl/blob/71cad106cefef671907ba7791b28b19fa2cc034d/tutorial18_billboards_and_particles/tutorial18_billboards.cpp Screenshot: ...


1

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