Modern Tessellation Based Planet Renderer needs Collision

Started by
4 comments, last by AbhijitNandy 11 years, 9 months ago
[color=#323D4F]So I wrote a basic planet shader which takes a very low poly (32 triangles) sphere and tessellates it to up to 2 million triangles of detail for the surface of the planet. This is a real time dynamic LOD all done with the tessellation processor on the GPU. That means I never store the result. As far as the other parts of the shaders are concerned, as well as the c++ end, it's still a 32 triangle sphere. The issue comes when trying to simulate physics. I've already worked out how to do gravity when near planets, that's fine. What I'm worried about now is how to simulate collision when something actually lands on a planet.

[color=#323D4F]Obviously, it's out of the question to generate a 2 million triangle shape and pump that into bullet. But the planet is generated from perlin noise based height maps (using cube mapping), so I thought maybe I could use the height map shape in bullet, but I realize that's only for 2d. I can certainly generate some very basic geometry for bullet but because of the size of a planet, I'm worried it won't be high enough resolution when a player is just walking on the ground.

[color=#323D4F]So my question is, am I still stuck generating LODs for physics simulation anyway? Or does anyone who perhaps has more bullet experience have a better idea of how to accomplish this?

[color=#323D4F]I am still working on the atmospheric scattering shader, so I haven't delved into this but am starting to think toward the future a bit, and can't lie that I'm a bit worried that it will be a show stopper.
Douglas Eugene Reisinger II
Projects/Profile Site
Advertisement
You should probably generate the physical object only.for the area near the player.

o3o

That's what I was thinking in the end, make a dynamic VBO, and then stream the data as the user moves near a planet.
Douglas Eugene Reisinger II
Projects/Profile Site
No i meant the one used for collision detection. You could generate the whole planet on GPU, and then using CPU sided version of the algorithm or by asking the GPU, get the triangles for the area near the player so you can do collision against them. So you dont need a huge mesh to do collision against.

o3o

Good point, although I doubt I'll ask the GPU for the data, unless I'm using OpenCL or something. I'll probably just generate a lower poly version and stream sections of it depending on where the player is. Thanks for the tips man!
Douglas Eugene Reisinger II
Projects/Profile Site
Thats what I do too. I generate a triangle mesh covering a small number of latitudes and longitudes (in fact in radian measure its something like 0.000024f rads wide and long). I recreate the mesh and insert it into the bullet dynamics world each time the object it supports move beyond the edges(otherwise the object supported will fall off)

This topic is closed to new replies.

Advertisement