←back to thread

241 points fschuett | 4 comments | | HN request time: 0.213s | source
1. Archit3ch ◴[] No.45662996[source]
> OpenGL 1.1-style implementation on software

How many lines to implement OpenGL 2.0 (non ES) ?

replies(3): >>45663054 #>>45664278 #>>45666931 #
2. Pannoniae ◴[] No.45663054[source]
An order of magnitude more ;) You need to implement user-programmable shaders, both ARB assembly and GLSL. That needs a GLSL parser, a shader interpreter (talking about compiling it to machine code would add another magnitude of complexity).

You also need to implement multitexturing (probably the easy part) but also all the texture combiner stuff too. This one is not hard but also a good chunk of code...

All in all, at least 40K if you ask me, but that's a very lowball estimate.

Of course if you don't care about implementing the full spec, you can get away with a lot less.

3. 0x0203 ◴[] No.45664278[source]
Not sure what the line count is, but PortableGL is a software renderer for 3.x(ish):

https://github.com/rswinkle/PortableGL

Cool project, and fun to play with.

4. eska ◴[] No.45666931[source]
I implemented the OpenGL API for fixed function hardware once, and chose the cut off at 1.5 with some extensions like framebuffer objects. 1.x has a lot of cruft that nobody should use, but is still easy to implement. 2.x has a lot of stuff like shaders that are a lot more work to implement in software.