Open fehaar opened 12 years ago
I was researching culling last night from a terrain standpoint and thought I'd share a find: http://www.dustinhorne.com/post/2011/10/18/XNA-Terrain-with-LOD-Part-7-Better-Culling-With-2D-Shapes.aspx ...you can download whole project at bottom. Looks like he is at the beginning of implementing Billboarding the same way unity does with trees. Not sure if any methods here would be of interest.
I was thinking about working on Terrain integration today...any thoughts on this approach: Option A: creating heightmaps using unity's built in tools and then loading the heightmap in both unity and xna in similar ways: http://www.unifycommunity.com/wiki/index.php?title=HeightmapFromTexture ...converting to .cs of course.
Option B: Converting the terrain to an object and then can easily bring into XNA: http://www.unifycommunity.com/wiki/index.php?title=TerrainObjExporter
Not sure if Heightmaps are faster? A little more cumbersome from a design standpoint, but there are tuts out there for how to do in XNA.
I would finally look at being able to walk on the terrain using a technique like this: http://forums.create.msdn.com/forums/p/81553/493416.aspx#493416 ...has anyone tested character controller conversion yet from Unity to XNA. Or have an example of a player being able to walk and collide on a mesh in XNA? I will also research tagging options as eventually I'd like to import trees and tag a tree a tree and a terrain a terrain and finally via billboard culling have something hopefully similar to what unity is doing.
I looked at the QuadTree sample. It is very complete, but also seems to be geared towards making culling of a terrain type mesh. So maybe it makes sense to do that for terrains in FFWD as well. I have been looking at doing a more general OctTree culling approach in FFWD. But this is still underway.
Regarding terrains I think you should go for option A. Since you seemingly cannot get to the generated terrain mesh in Unity (?), you will have to create the terrain mesh by hand anyway. So I think that the best approach is to generate the heightmap in Unity and export it to XNA. Then generate the mesh in XNA. In that way it is easier to generate the Mesh in XNA in a format that is suitable for FFWD and gives you the best performance..
And for your second question. I have not been looking at the character controller at all. And depending on the terrain, I think you might find it to be a huge issue that FFWD is only using a 2D physics framework right now. So walking on a mesh will only work if you can map what you walk on to a 2D space. I have been looking into getting the 3D engine BEPUPhysics to run in FFWD - but I have not made a serious attempt at getting it in. So that would have to be done as well.
Create an treestructur to help us do faster culling. Should also be used for breaking up static batches instead of the current tile based system.