Page 1 of 1
Mesa 3d
Posted: Thu Nov 24, 2005 11:35 am
by lvella
Taking the idea from the discussion in
http://forums.ps2dev.org/viewtopic.php?t=1559, why not to port Mesa 3d (
http://www.mesa3d.org/) to ps2, which is a full OpenGL implementation, instead of writing a completely new one such as DreamGL?
As long as I know, Mesa uses XFree DRI to talk with GPU, so, to port to PS2, it would only be necessary to make the interface with PS2 hardware, replacing the XFree interface.
Is there any special reason that Mesa was not already ported to PS2 that I don't know? Or nobody simply hasn't wanted/tried to do it?
I have much to learn before I can do that...
Posted: Tue Dec 06, 2005 10:56 am
by dreamtime
Hi Ivella,
// Somehow I always end up writing long freaking essays...
// So sorry for such a long answer to such a simple question/comment.
// I am writing this at work :-)
When I started thinking about writing a 3d lib for the PS2, Mesa and the newly opened SGI reference implementation were the first things I thought of porting.
After a day or so looking at the source of both, one thing became really clear: a full OpenGL implementation is one huge and scary piece of code.
I decided to scale back and only build the bare minimum functionality to be able to write something like Quake 1...ie: a simple polygon pipeline, and the multitexture extension for lightmaps (someone at the time described the PS2 as a 3dfx card on steroids, so I thought this was appropriate :-)
So, why not use the Mesa or SGI code as a base anyway, and stub out the stuff I wasn't implementing, setting it all up for other to extend later?? Two things scred me off here:
* It looked like even just working out the build system (especially of the SGI one) would take me a month.
* A lot of their code is autogenerated, or built in such a way to make everything consistent and extremely portable (although it seemed to assume you would have direct access to a framebuffer a lot of the time)....it would take me another month to work out why they were doing certain things the way they were. For the simple subset of functionality I wanted to implement, it all looked way too complex and convoluted to use as a base.
* Also, my code would of course be better :-)
But, the most important reasons for starting from scratch with DreamGL were:
* I was (am) a newbie (re)learning 3D math, OpenGL, and the PS2 at the same time. I wanted to spend more time focusing on all that rather than the nuances of someone else's implementation.
* I wanted to keep the code as simple and naiive as possible, so others could also learn from it. I wouldn't optimize a single line until it was all complete (I totally agree with Donald Knuth about premature optimization) (I did write a bunch of VU0 routines that I haven't released that did speed things up considerably...that was going to be Tut 3c)
* I wanted to write a bunch of 3D tutorials to continue on from the other ones, using DreamGL as the sample app being built, ie: Tutorials 3a, b, c, and d (Tut 3D was going to be the fully VU1 optimized, with pluggable back end, DreamGL Version 1.0).
I think I've achieved MOST of the first two points and none of the third :)
The main reason(s) I stopped working on things are called Gabby and Alex (who are 2 years and 5 months old) and are taking up all my time :-)
So, back to your question, that's why --> I <-- didn't do it :-)
I think it's a worthy project for someone to take on, just be aware of the scope of the thing!
Cheers,
Dreamtime