Jump to content
  • Advertisement
  • entries
  • comments
  • views

Non-Euclidean physics (for real this time)

Sign in to follow this  


I know, I know. I've got the whole boy-who-cried-wolf thing going on here, but it actually works this time!

It's crazy computationally expensive, the whole thing.

The rendering is awful. Since there's no way to predict both accurately and cheaply the max bounds of a polygon, there's no good way, from what I can think of, to cull off-screen objects other than over-estimation. It's currently being calculated by finding the maximum amount that any point in space can move, given the distortions, and sweep the bounding box to come up with something I can do a window test against. I currently don't see a better way to do it, though. Gaussian transforms don't play well with efficiency, but they look soooo pretty sad.png

The physics is the same way. The only way to quickly cache possible collisions, without actually doing a full computation, is to do the same sort of sweeped-box thing that the renderer does. This is actually a big problem, because over-estimation scales very rapidly. The physics solver is iterative, so false-positives scale.

So when I explain this to people, their first reaction is along the line of "Well, why can't you determine the max bounds of a polygon at runtime? You draw the polygon at runtime, why can't you cull them at runtime?" It's tricky. Because warping doesn't just happen at vertices, but also inside polygons and at the edges. This means that an analytic solution would be a bit obtuse as an efficient method to cull objects, because if I was smart enough to figure it out then it'd still be at least as complicated as the actual distortion function.

So what's the framerate like? It usually stays around 60fps, but it's pretty easy to make a distortion that brings the simulation down to around 30fps or so. That's BAD. There's really nothing going on in the prototype right now besides rendering and physics, and it can barely keep a 60fps budget.

At this point, I'm kind of at a loss. Either I can settle for a constant 30fps or I can figure out a different way to do things. Maybe I could find a simple over-approximation of the distortions. Maybe I could get a better computer and act like nothing happened.

Oh well. I'll see where this goes.

As always, here's a look at how awesome everything is right now. The physics is pretty much impenetrable, and the rendering looks sufficiently smooth. Now to actual content! :D
Sign in to follow this  


Recommended Comments

There are no comments to display.

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!