Forum

TinyGL

Discuss programming topics that involve the OpenGL API.

Moderator: InsideQC Admins

TinyGL

Postby leileilol » Mon Apr 14, 2014 12:54 am

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
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: TinyGL

Postby Spike » Mon Apr 14, 2014 2:19 am

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.
Spike
 
Posts: 2878
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: TinyGL

Postby mankrip » Mon Apr 14, 2014 6:38 pm

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
User avatar
mankrip
 
Posts: 914
Joined: Fri Jul 04, 2008 3:02 am

Re: TinyGL

Postby leileilol » Mon Apr 14, 2014 11:01 pm

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
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: TinyGL

Postby mankrip » Mon Apr 14, 2014 11:42 pm

: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
User avatar
mankrip
 
Posts: 914
Joined: Fri Jul 04, 2008 3:02 am

Re: TinyGL

Postby leileilol » Tue Apr 15, 2014 12:17 am

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
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am


Return to OpenGL Programming

Who is online

Users browsing this forum: No registered users and 1 guest