Tesselation and colision?

I was wondering (thinking ahead of time about 4.X and targeting DX10), if i have some large terrains that area heavily tesselated, how can i handle colision? if i use the base mesh for collission the player could easily end up bellow or above terrain.
Any tips?

Well, if you are using a map for the tesselation (I’m not entirely into dynamic tesselation, so pardon if I say stupid things here) you could sample that map to get additional info about the terrain at some point. But it would mean you didn’t use the build-in collider against collider system, but instead just used rays. If you each frame send a ray downwards, and pick up a collision position (from the simple mesh, before tesselation), you could modify this collision position (RaycastHit.point) with the data of a corresponding pixel of the tesselation texture, to take into account the changes of the tesselated mesh.

Idea?

1 Like

I think that best thing would be to make collision mesh by yourself, simply by using polygon cruncher on your tessallated terrain mesh within 3ds max, or decimation master in Zbrush, and then exporting some appropriate version as collision layer. However i am not sure why would you need tessellated terrain, the only game with it i have noticed so far was Star wars Wars, and they didnt have collision problems becouse of game style that didnt require it. And also if you want to tessellate terrain so much that the old collision would be useless, then you are already tessellation it way too much, your textures will be way too stretched becouse UV data will be used from basic terrain mesh, only solution there could be triplanar shaders.

1 Like

Textures won’t get overly stretched, tesseleation will be to add detail (mostly raw tesselation to add polys, not much for displacement) but that will still end up distorting the mesh “a bit”, i don’t expect things like being in the middle of the void, but i can definately imagine say , part of the feet, being underground which could look crappy. No using having a 1M tesselated terrain if you have visible artifacts just under your nose

Also working with a lower mesh leaves the same issue, if the terrain is very round and the mesh flat, there will be rendering artifacts.

Physx should be using the height map of your terrain for collision, it doesn’t care how its rendered. If you don’t use Unity terrain though then yes you will have to build your own collision mesh.