Jump to content
  • Advertisement
Sign in to follow this  
Enalis

Modern Tessellation Based Planet Renderer needs Collision

This topic is 2169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!