Jump to content

  • Log In with Google      Sign In   
  • Create Account

Modern Tessellation Based Planet Renderer needs Collision


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 PaloDeQueso   Members   -  Reputation: 283

Like
0Likes
Like

Posted 12 July 2012 - 11:04 AM

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.

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.

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?

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

Sponsor:

#2 Waterlimon   Crossbones+   -  Reputation: 2565

Like
1Likes
Like

Posted 13 July 2012 - 05:12 AM

You should probably generate the physical object only.for the area near the player.

o3o


#3 PaloDeQueso   Members   -  Reputation: 283

Like
0Likes
Like

Posted 13 July 2012 - 08:02 AM

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

#4 Waterlimon   Crossbones+   -  Reputation: 2565

Like
1Likes
Like

Posted 13 July 2012 - 08:42 AM

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


#5 PaloDeQueso   Members   -  Reputation: 283

Like
0Likes
Like

Posted 13 July 2012 - 03:13 PM

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

#6 altreality   Members   -  Reputation: 108

Like
0Likes
Like

Posted 14 July 2012 - 04:45 AM

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)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS