• entries
    732
  • comments
    1562
  • views
    492570

Dirty deeds done with sheep

Sign in to follow this  

240 views

I return from a bug-fixing hunt. Let me lay my bad trip on you.

Racist

So I was getting this insane bug (on the Mac only) where stuff rendered a spew of polygons all over the screen, ruining everything. I couldn't figure it out; I harassed SHilbert, I rewrote the vertex buffer class from the ground up, I tore apart the model loader which I had just written and practically rewrote that, I ran the entire model loader in Guard Malloc for two hours, I stared and yelled and felt bad about myself.

In the end, it turns out that glDrawArrays takes size to mean the number of vertices instead of the number of array elements, unlike every other function in OpenGL related to vertex arrays. I can't believe Afterglow and Novarunner/Complex ran for as long as they did without me ever noticing that bug occurring. I guess this time around, the models were just so large that they pushed into some other chunk of VRAM.

I made an Executive Decision to leverage the proclivities of Tokamak in order to test out physics, and it seems my teammates have agreed that is probably a good idea. Therefore, I went ahead and cracked open the source distribution and
">ported it to my Mac (YouTube video!) for no good reason whatsoever. But there it is running (with me massively misconfiguring the rigid body and hacking in groundplane collision).

You might even see a little car tooting around before the end of the week. Don't count on it, though -- there's exciting paperwork to be done.

Afterglow

I fixed the vertex buffer bug in Afterglow as well as did a little bit of tuning to prepare for corpses. This is maybe the only industry on Earth in which I can say the words "tuning to prepare for corpses."

Speaking of the industry, I'm starting to waffle back towards giving the games industry proper a try. Professional software development is stable and responsible and all, but there's no sense of fun, and it's just as badly managed (if not more so). If I'm going to be underpaid and overworked, I'd rather do it doing something that I like. More on this later, or maybe not.

Linkage

If you haven't checked out the aforementioned SHilbert's not-aforementioned blog, you should do it now. His XNA game is pretty awesome.
Sign in to follow this  


6 Comments


Recommended Comments

Quote:
Original post by Ravuya
This is maybe the only industry on Earth in which I can say the words "tuning to prepare for corpses."


Perhaps as a morgue worker, rearranging the furniture?

Also I'd recommend Bullet for a physics engine, it's very fully featured and stable. I don't have a clue what its Mac support is like though. When I was looking for a physics library Tokamak had a nice feature list but its community was populated entirely by spam-bots and the documentation was awful.

Share this comment


Link to comment
Haha.

Whenever I have bugs like that on Mac builds and I'm showing somebody a Mac build, they look at the problem and say, well why is that happening? Generally, i pay much less attention to my Mac builds, only testing them out once every few weeks. So my reply usually is, "Because Macs suck".

Share this comment


Link to comment
As it turns out, the bug manifested also on Windows machines running older Intel integrated GPUs, because reading outside of the bounds of the GPU (CPU) memory triggered a system crash.

So it's not just a Mac thing; it just looks like for whatever reason the bug just never showed up from however the Windows GPU drivers allocate VRAM.

Quote:
Also I'd recommend Bullet for a physics engine, it's very fully featured and stable. I don't have a clue what its Mac support is like though. When I was looking for a physics library Tokamak had a nice feature list but its community was populated entirely by spam-bots and the documentation was awful.
I am starting to become slightly irritated with Tokamak as I use it; it looks like the giant internal drama they had has seriously fucked up their ability to document anything at all. Luckily we're early enough in that switching to Bullet should be relatively easy. I'll try that out tonight.

Share this comment


Link to comment
Bullet, eh? I'm still split on what I want to do for my latest XNA project. It seems like there isn't an ideal solution. I'm looking for something that can handle arbitrary poly meshes, as well as have some decent performance (ie: not handling non-moving objects, or being able to turn things on/off quickly for objects that are out of range of the player). I still haven't come across anything that seems like it can handle this, and most of the XNA related physics projects out there are either half-baked ports or are no longer being developed (and haven't been touched in a year). I'm not really looking forward to having to roll my own solution, but I'm thinking it might come down to that.

Share this comment


Link to comment
Quote:
In the end, it turns out that glDrawArrays takes size to mean the number of vertices instead of the number of array elements,

I find it strange, you would of noticed something was up before.
glDrawArrays doesnt use elements indices at all

ie its like calling drawelemtnes with

indices[] = {0,1,2,3,4,5,6,7,8,9,10.......};

Share this comment


Link to comment
Well, it did show up on Intel integrated (a 915GM exploded after having that thrown at it for no apparent reason) and it did show up later on the target machine when I tested it with a 1M+ poly model.

It is kind of surprising that I didn't have that crash before. I suspect it may have contributed to the reports I got about Novarunner in the beta phase about its crashiness on crappy video cards.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now