3 ms·
Thanks! It was honestly kind of a dark path. The graphics are based on Three.js (which is awesome), and I initially rendered everything with a rarely-used WebGL
by pierrec 3y ago
Thanks! It was honestly kind of a dark path. The graphics are based on Three.js (which is awesome), and I initially rendered everything with a rarely-used WebGL/OpenGL feature called GL_POINTS, which seemed like a smart way of doing an impressionist style. Three.js exposes it like this: https://threejs.org/docs/#api/en/objects/Points https://threejs.org/docs/#api/en/objects/Points
Of course, things are never that simple, and it turns out you can't just draw a million points with GL_POINTS, performance is terrible, they don't efficiently occlude each other, etc. So I rendered the terrain as regular triangles, and wrote a terrain shader that makes it look like the triangles are made of points. I re-wrote that shader several times, and actually, it's still not working correctly, but at some point you have to stop. That shader is here: https://github.com/pac-dev/AmbientGarden/blob/master/Web/versioned/js/gfx/nearMaterial.js https://github.com/pac-dev/AmbientGarden/blob/master/Web/ver...