The Evolution of Direct3D
alexstjohn.com
alexstjohn.com
"Direct3D was not an alternative to OpenGL [...] it was a designed to create a competitive market for 3D hardware"—and how it ultimately failed, with Direct3D becoming like OpenGL, more confusing, and paving way for the alluring simplicity of developing for a single hardware specimen—the Xbox.
Not a new idea, but one I'm glad to be reminded of.
I'm totally going to put some time into playing with this. Anyone here already doing something cool in the custom GPU renderer space?
You see, on PS3 GPU there are no pixel shader constant registers. This means you need to patch shader code if you want any alterations in your pixel shader. A naive approach, with patching on CPU when submitting every primitive, is horrendously slow because the CPU sucks at moving large amounts of data. A slightly faster approach, using the GPU DMA, is still unbelievably slow, because even though the GPU moves large amounts of data very quickly it takes a lot of time to switch between pushing triangles to copying mem ranges and back. Luckily, on the PS3 there are also SPUs, pretty good at moving large amounts of data and having no penalty for doing so. Patching shaders on SPUs is so fast you forget about it. Also very easy to write.
So the mind boggles when you see people using GPU patching and, to somehow save peformance, do some complicated scheme with occlusion culling via SPU.
OpenGL was elegant and very simple to use, quickly becoming close to invisible. DirectX, in comparison, was layers upon layers of COM book-keeping code.
Of course OpenGL has become like DirectX in more recent iterations, as in the end immediate satisfaction is less important than flexibility.
COM really wasn't that much of a hassle in comparison. A couple smart pointer templates and you're off to the races. I can see how a C developer would really resent it though - nothing but a pain compared to GL's regular C, 'everything is void*' api.
When one works for corporations of similar sizes, gets to learn that there are many factors at play, than just good or evil deeds.
Dear author, you being the one who chose the coordinate system of D3D: thanks a lot. >:-(
At least with endian issues, for example, there was once maybe a compelling reason to do it from a hardware standpoint.
There is some logic to left-handedness, which is a bit more intuitive in some ways for computer graphics. Left-handed means the Z coordinate increases with depth into the screen, that the viewer is somewhere near Z = 0 and looking towards positive numbers. And projection space has 0.0 at the near plane of the view frustum and 1.0 at the far end. Right-handed means that either your projection space coordinates go negative or that your projection matrix includes a negation for the Z coordinate.
Left-handed does however have the enormous disadvantage of working against almost all (non-computer screen) representations of 3D space. Draw your X and Y axes on a sheet of paper in their customary orientation. It's much more intuitive to interpret positive Z as altitude above the paper rather than as depth into your desk. That's right-handed, and that's why OpenGL and everyone else chose that.
Answering a different parent, it's more than just one line of code in a library to change coordinate systems. The depth buffer check needs to compare in the opposite direction, for one.
Incidentally, Microsoft has learned from this mistake: XNA uses right-handed coordinates.
XNA and its former incarnation, Managed DirectX, always suffered from the internal political differences between .NET and native tools development groups.
Wouldn't that be a thing?
>> I personally never imagined that my early work on Direct3D, would, within a couple decades,
>> contribute to the evolution of a new kind of ubiquitous processor that enabled
>> the kind of incredibly realistic and general modeling of light and physics that
>> I had learned in the 1980′s but never believed
>> I would see computers powerful enough to model in real-time during my active career.
I concur.
I'm much older than Alex St John.
Coding for 3D has never ever been as fun as it is now...
And Wild Tangent is one of the most annoying/useless pre-loaded crapware vendors -- I've never seen their software installed except on a brand new PC.
[1] http://www.maximumpc.com/article/features/old_school_monday_...