Terrain Collision for Geo-mipmapping based algorithms

Started by
3 comments, last by kauna 12 years, 4 months ago
Hello,

I am wondering if anyone here can discuss some techniques for implementing collision detection / terrain querying for terrain engines that rely on geo-mipmapping techniques (such as geo clipmapping etc). Since all geometry is offset and actually height calculated on the GPU I am wondering how entities can perform height queries and also normal queries on the terrain. Reading geometry back is not an option as the transform happens on the GPU and the vertex buffer is unaltered (need this to work for D9 which it seems this has been done). The only other option I see is querying the heightmap itself but it seems lots of texture readbacks would be very expensive. Can any one shed some light here? Thanks - R
"Do not fear mistakes. There are none." - Miles Davis
Advertisement

Hello,

I am wondering if anyone here can discuss some techniques for implementing collision detection / terrain querying for terrain engines that rely on geo-mipmapping techniques (such as geo clipmapping etc). Since all geometry is offset and actually height calculated on the GPU I am wondering how entities can perform height queries and also normal queries on the terrain. Reading geometry back is not an option as the transform happens on the GPU and the vertex buffer is unaltered (need this to work for D9 which it seems this has been done). The only other option I see is querying the heightmap itself but it seems lots of texture readbacks would be very expensive. Can any one shed some light here? Thanks - R


You should be able to use the same math that generates the height on the GPU with the CPU, depending on your solution. Querying the heightmap seems the first and easiest way.

I would have said test geometry but I'm not sure what transforms you're doing on the geometry in the GPU, once again you should just be able to use the same math as the GPU uses, and as long as you're not doing lots of height tests it shouldn't be too expensive. Trying to read a texture from video memory is expensive, so you might end up with a memory duplicate of the height map though, one in ram and one in video memory.

For stuff that you'll have a lot of height tests for, maybe a fluid simulation or something, you might want to pre-compute the boundary of that fluid, and then use that boundary to pre-compute the height values that the fluid will need in real time.
I say Code! You say Build! Code! Build! Code! Build! Can I get a woop-woop? Woop! Woop!
The only other option I see is querying the heightmap itself but it seems lots of texture readbacks would be very expensive
Don't read the GPU's copy of the texture -- keep a separate copy of that pixel data for yourself (preferably not even in a D3D type object - just an array of bytes would do).
I am wondering if anyone here can discuss some techniques for implementing collision detection / terrain querying for terrain engines that rely on geo-mipmapping techniques (such as geo clipmapping etc). Since all geometry is offset and actually height calculated on the GPU...
I think I'm missing something
Geomipmaps.
Clipmapping.
The connection between the two is loose at best. Neither algorithms compute height on GPU.
For geomipmaps, computing collision on the finest mesh only appears reasonable.
I cannot say much for clipmaps.

Previously "Krohm"

Hi,

Base line every time should be to keep graphic related stuff (textures, geometry etc) separated from other things such as physics.
Terrain collision is a question related to physics. Anything with the word "collision" is more or less physics related question.

Practically you should have a separated physical model for handling collisions. The physical model may be less accurate than the graphics presentation, which may be good in some cases. Depending on the size of the terrain you may or may not keep the whole physical model in memory all the time.

Best regards!

This topic is closed to new replies.

Advertisement