Page 1 of 1

TinyGL

Posted: Mon Apr 14, 2014 12:54 am
by leileilol
http://bellard.org/TinyGL/
https://github.com/kimperator/TinySDGL
https://github.com/residualvm/residualv ... ics/tinygl

It's a bit antiquated and severly lacking in features, but one thing I want to try is getting this working as a renderer module in ioq3 under renderer_software. I could probably try to add blending functions afterward. Maybe... or get my content adapted to the limitations, even if it's going have to be 16-bit color in vertexlight with low textures without mipmaps or filtering.

The most mature implementation with improvements is the one in ResidualVM, where they at least have alphatest working.

Why software? BSD that's why. Often, the performance complaints involve the Mesa3D generic rasterizer on a non-Windows platform where an option for a faster software rasterizer isn't available. It's a battle I can't win.

Re: TinyGL

Posted: Mon Apr 14, 2014 2:19 am
by Spike
the only way to really make an efficient software renderer is if you provide your own shader functions to reduce overhead, and incorporate threads somehow, and write it using sse intrinsics or asm, and avoid floats like the plague.
tinygl has a triangle rasteriser, but the rest is all pretty much just extra overhead.

Re: TinyGL

Posted: Mon Apr 14, 2014 6:38 pm
by mankrip
Spike wrote:the only way to really make an efficient software renderer is if you [...] avoid floats like the plague.
Agreed. And...
TinyGL website wrote:The main features of TinyGL are:
[...]
* 32 bit float only arithmetic.

Re: TinyGL

Posted: Mon Apr 14, 2014 11:01 pm
by leileilol
But!!!
TinyGL website wrote:TinyGL is that it is fast ...

...the texture mapping and the geometrical transformations are very fast. ...

...TinyGL is a lot faster than Mesa...

...Fast Gouraud shadding optimized for 16 bit RGB....

...Fast texture mapping...

Re: TinyGL

Posted: Mon Apr 14, 2014 11:42 pm
by mankrip
:P It may be fast, but it could be faster if it used fixed-point arithmetic instead.
Anyway, good fixed-point arithmetic requires significant more work and makes the code harder to understand, so it's understandable that they've used floats instead.

I thought of doing a proper fixed-point port of Quake once. The PocketQuake source is very unoptimized, and could be a lot faster if the arithmetics were properly ported instead of employing Dan East's translate-calculate-retranslate method. But when I realized the amount of work it would take, that idea went out of the window.

Re: TinyGL

Posted: Tue Apr 15, 2014 12:17 am
by leileilol
I don't have this working with q3 yet so I'm not sure how slow this floating stuff you speak of really is. Maybe brute force lookups and turning goraud shaded vertex colors down to Quake-style mono shading would help. In theory.


There's no avoiding floats in OpenGL anyway. While SSE sounds fun, i'm targeting non-SSE platforms for this.