Saturday, December 13, 2008

Updates

Nothing done yesterday because I went to the pub. :)

Finished off the 2D drawing today; I'm reasonably happy with how I've got it done although I'm thinking that I'll probably want to go back and rework the vertex structs at some future time. That puts me pretty much feature-complete so far as porting is concerned, I think.

I had ripped out all alias model code a while back, so I'll be putting that back in later on, doing some cleaning up of stuff I wrote while figuring out what to do, and then hopefully it's release time!

Regarding the GL engine, it's coming near decision time as regards what to do with it. I'm certain that it's current shape and form is going to be abandoned at this stage; I don't see much mileage in continuing with it as I've been finding GL too frustrating to get any personal satisfaction out of.

Way I see it now is that GL is easy to get started with but annoying once you start getting advanced. D3D on the other hand is the exact opposite; annoying first, then really easy. I think Carmack maybe just didn't try hard enough back in 1996.

Specific example: the surface vertex format in Quake is extremely Direct3D-friendly. You can draw an entire surface in a single line of code. That's an actual API call, not an internal function call:

d3d_Device->DrawPrimitive (D3DPT_TRIANGLEFAN, surf->vboffset, surf->numedges - 2);
You can do the same with OpenGL vertex arrays, of course, but I'm referring here to the specific way GLQuake was written and to the specific examples in Carmack's famous rant. Other nice things are lightmap uploading (really neat and elegant, no need for keeping the data in main memory), resolution changing, external texture loading (not done yet, but it will rock like a mofo).

True, OpenGL has the advantage of portability, but at what cost?

Anyway, the big decision is do I port the GL engine to D3D or do I port the new stuff from the GL engine into the D3D engine? I'm inclining towards the latter option, as - while there's a lot of new stuff to port over - there's also an awful lot of mess that was required to get things working in GL (mostly things that should "just work") that needs to be cleaned out. Moving forward seems to me to be more fulfilling than cleaning out a mess.

I might release the current GL codebase as an "unfinished work", although I do also think that what Reckless has done with one of my earlier codebases is a great representation of where I was wanting to go, and I fully endorse and approve of it, and so I might also just leave things be.

0 comments: