Rick Posted September 5, 2013 Share Posted September 5, 2013 First off is there a Terrain documentation page? Can't seem to find it. Also, are we able to manipulate the terrain at run-time? I'm thinking of like an RTS when you place a building on the terrain and want to flatten the land under where the building will be placed. I want to be able to get the verts and change their height. If possible at this time, does this screw up the terrain collision/navmesh at all? Would I have to recalc things? If so how and can I do it today? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 5, 2013 Share Posted September 5, 2013 Reaction from Josh In the future, a combination of static and dynamic data will be used, much like how the shadowmaps in Leadwerks 2 work, but for present we will rely on precalculated data generated in the editor or by a command. Looks like the navmesh can be generated when you have altered the terrain at some point in your game. I have no idea terrain deformation is possible right now. at least not with the API. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 6, 2013 Share Posted September 6, 2013 Programmatic terrain manipulation is not presently supported, officially. That said, there are lots of things you can find if you browse the header files. There may even be a World::BuiltNavTile(x,z) function that may even work. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tournamentdan Posted September 6, 2013 Share Posted September 6, 2013 You should be able to create a displacement map of the size of the flat area you need for a building. Then use the displacement map as a decal, then tesselate the terrain. Although nav mesh is now not dynamic. So they will not match. It would be a nice feature if we could update the nav mesh with a specified distance from a ray-cast. Quote Link to comment Share on other sites More sharing options...
Rick Posted September 6, 2013 Author Share Posted September 6, 2013 That sounds more complicated then just flattening the terrain verts around the area the building is? Quote Link to comment Share on other sites More sharing options...
tournamentdan Posted September 6, 2013 Share Posted September 6, 2013 That sounds more complicated then just flattening the terrain verts around the area the building is? Using a decal is not complicated. Tesselating a displacement map is not complicated. Doing a ray cast is not complicated. What is complicated is just flatening mesh in a realistic manner. Quote Link to comment Share on other sites More sharing options...
Rick Posted September 6, 2013 Author Share Posted September 6, 2013 Tesselating a displacement map sounds complicated to me. :-/ I guess taking the x/z bounding box of the building and getting all verts inside this area and I was going to pick the average height value and make that the height value of all the verts. Was also going to do a check that if the lowest point and highest point are > a threshold then the land will be deemed to hilly to place a building on. Guess that just sounds easier to me. Quote Link to comment Share on other sites More sharing options...
tournamentdan Posted September 6, 2013 Share Posted September 6, 2013 Tesselating a displacement map sounds complicated to me. :-/ I guess taking the x/z bounding box of the building and getting all verts inside this area and I was going to pick the average height value and make that the height value of all the verts. Was also going to do a check that if the lowest point and highest point are > a threshold then the land will be deemed to hilly to place a building on. Guess that just sounds easier to me. Your terrain mesh would have to be extremly high in poly count or it is going to be blocky around where you flatten. So your game will not crawl at 3 fps you will need a normal terrain poly count and then somehow add vertice around where your buildings are. Oh yeah, I guess you could tesselate. Which will most likely be easier than your above method. Quote Link to comment Share on other sites More sharing options...
beo6 Posted September 6, 2013 Share Posted September 6, 2013 Just see that it does not end looking like this: (sorry. it just remembered me of this bug i had) Quote Link to comment Share on other sites More sharing options...
Rick Posted September 6, 2013 Author Share Posted September 6, 2013 @Tournamentdan I'll be using LE terrain so as far as I know we can't increase/decrease it's poly count. I think LE's terrain has or plans on having automatic tesselation. I remember Josh talking about that. @beo6 Nice Quote Link to comment Share on other sites More sharing options...
tournamentdan Posted September 6, 2013 Share Posted September 6, 2013 @Tournamentdan I'll be using LE terrain so as far as I know we can't increase/decrease it's poly count. I think LE's terrain has or plans on having automatic tesselation. I remember Josh talking about that. @beo6 Nice Yes, you can not use tesselation untill josh implements the new renderer. But there is plenty to be done before then. I do not know about automatic. Tesellation will be handled in a shader. You with code will have to specify level of tesselation and distance from camera. The way I decribed will allow you to increase/decrease poly count in a specific local area instead of across the whole area. If you plan to use the "automatic" tesellation with your method you will have to do all that picking and checking every frame or at least many times per second since every time the camera moves, more or less vertice will be created or deleted. Good luck with your prodject. Quote Link to comment Share on other sites More sharing options...
Rick Posted September 7, 2013 Author Share Posted September 7, 2013 I'll play around with the undocumented way of changing verts to see how it works out. In my head at this time I just don't think it'll be a problem as the terrain is today as there seems to be plenty of verts to flatten out for the buildings I have in mind. Testing will tell me more if those undocumented commands even work. Thanks for the alternative idea. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.