Live data from Hacker News

TinyGL 0.4.1

bellard.org

1–10 of 40 posts

Re: TinyGL 0.4.1

#6
post #2

Taking 20 years to move from 0.4 to 0.4.1 seems like a long long time.

Well, I'm surprised he has the time/intention to do that in between for us mere mortals. Here are a few references;

- https://en.wikipedia.org/wiki/Bellard%27s_formula

- https://en.wikipedia.org/wiki/Fabrice_Bellard

``` In April 2021 his Artificial Neural Network based data compressor, NNCP, took first place out of hundreds in the Large Text Compression Benchmark. To write the compressor, Bellard wrote his own Artificial Neural Network library, LibNC ("C Library for Tensor Manipulation"), publicly available. ```

Re: TinyGL 0.4.1

#7
I used to work on a project called glshim (which ptitseb still maintains as gl4es, used by box86). glshim implements an ABI-compatible OpenGL 1.x fixed function API (as libGL.so.1) on top of an OpenGL ES 1.x driver. This allows you to accelerate completely unmodified OpenGL programs on mobile Linux devices such as the OpenPandora.

This approach even works with x86 user-mode emulation, by serializing render commands into a shared memory ring buffer and running the driver in native code out-of-process (which as a bonus was also generally faster than rendering in-process).

I built glshim after hand porting a bunch of open-source Linux games from OpenGL to OpenGL ES. The last game I hand-ported like this was Introversion's Uplink Hacker Elite. The diff was thousands of lines, and the resulting port had buggy rendering and blurry fonts, so I got fed up with hand ports and started working on a universal solution.

After a few years, I had ironed out most of the bugs in glshim, and ports to the Pandora were much easier. Uplink, however, was still in a sorry state. It made heavy use of glBitmap for crisp font rendering, and glBitmap was very slow to emulate on top of OpenGL ES 1.x. glBitmap basically manipulates framebuffer pixels directly, and the easiest way I found to do that was to upload a texture and render it with GL_NEAREST. Texture uploads seemed to be extremely slow and CPU-bound on the Pandora's Cortex A8 / PowerVR SGX 530. I ended up batching subsequent glBitmap calls, trying to coalesce them into a single texture upload per frame, and with that I still only managed single-digit fps.

With glshim, I had a moderately complete OpenGL implementation that only relied on a small subset of the OpenGL ES API. Then I stumbled on TinyGL. I realized that despite TinyGL not implementing much of the full OpenGL API, it was very fast and implemented basically everything I needed from OpenGL ES for glshim to work. So I forked it as "TinyGLES", deleted the extra GL parts, and optimized the rendering paths for ARM NEON. It ended up making a really good software rendering backend for glshim. I used this to finally release a good version of Uplink for the Pandora, which ran at around 80fps! With TinyGLES, glBitmap could blit directly to the software framebuffer, avoiding the slow/buggy texture emulation path.

It had been a few years and I couldn't find the modified source for my Uplink port, so I just swapped out the libGL.so file when I updated Uplink to use TinyGLES. But some users found an annoying bug in the port. Anytime you restarted the game, it put you directly in the "new game" menu, instead of allowing you to pick between new game or loading a save. I ended up fixing this with a binary patch to the game executable (which forced the game to the main menu screen on every launch), and that's the version currently available for the Pandora: http://repo.openpandora.org/?page=detail&app=uplink

Re: TinyGL 0.4.1

#8
post #2

Taking 20 years to move from 0.4 to 0.4.1 seems like a long long time.

You might want to look at Fabrice Bellard's page and see what he has accomplished. He is a giant.

Re: TinyGL 0.4.1

#10
post #2

Taking 20 years to move from 0.4 to 0.4.1 seems like a long long time.

Well, I'm surprised he has the time/intention to do that in between for us mere mortals. Here are a few references; - https://en.wikipedia.org/wiki/Bellard%27s_formula - https://en.wikipedia.org/wiki/Fabrice_Bellard ``` In April 2021 his Artificial Neural Network based data compressor, NNCP, took first place out of hundreds in the Large Text Compression Benchmark. To write the compressor, Bellard wrote his own Artifi…

One glance upon the majesty of Bellard's works is enough to give even a 10x SWE imposter syndrome.
Post reply on HN