TinyGL

Discuss programming topics that involve the OpenGL API.
Post Reply
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

TinyGL

Post 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.
i should not be here
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: TinyGL

Post 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.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: TinyGL

Post 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.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: TinyGL

Post 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...
i should not be here
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: TinyGL

Post 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.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: TinyGL

Post 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.
i should not be here
Post Reply