About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Merge terrain edges editor interface
Author Message
Zervox Offline
Silver Supporter

Post: #1
Merge terrain edges editor interface
I've noticed when making areas through the editor interface, the mesh edges does not merge with their neighbours, I'd like to request either that this is done on setheight call or on a separate call which can be called afterwards.
01-08-2015 06:07 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Merge terrain edges editor interface
Hello,

You need to manually call the setting heightmap terrain through the interface on the neighbor areas.
01-09-2015 06:40 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #3
RE: Merge terrain edges editor interface
I am already using b.ok = EI.worldTerrainSet(world_id, temparea, tempHeight.heightImage(), materialMap, NULL);
I've also used
b.ok = EI.worldTerrainSetHeight(world_id, temparea, tempHeight.heightImage(), b.SMats[0].id());

but there is no way to tell the areas to merge their terrain edges.
None of these calls will make the edges merge their gaps.
01-09-2015 07:17 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Merge terrain edges editor interface
For example:
You need to set the Right Edge value of Left Area, to the same value as Left Edge value of the Right Area.
01-09-2015 07:38 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #5
RE: Merge terrain edges editor interface
It's not the same as when you draw a weak brush between the areas in which case the edges of the terrain are merged together, this, you can't do through images.
(This post was last modified: 01-09-2015 07:59 AM by Zervox.)
01-09-2015 07:58 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Merge terrain edges editor interface
Yes you can do this with editor interface methods, because it has Get Terrain Height methods,
1. Get Terrain Height of one area
2. Set Terrain Height of another area based on terrain obtained in step 1
01-09-2015 11:20 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #7
RE: Merge terrain edges editor interface
I am still having issues, I've already tried every pixel get function there is and the closest I've gotten is still leaving tiny gaps nothing compared to how the editor behaves when I apply a brush onto a spot on the areas.
01-09-2015 02:43 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Merge terrain edges editor interface
Code:
Edit.MaterialMap mtrl_map;
   EI.worldTerrainGet(world_id, VecI2(0, 0), height, mtrl_map);
   Image next;
   next.createSoft(terrain_res, terrain_res, 1, IMAGE_F32);
   REPD(y, next.h())
   REPD(x, next.w())
   {
      flt left=height.pixelF(height.w()-1, y);
      next.pixelF(x, y, Lerp(left, 0.0, x/flt(next.w()-1)));
   }
   EI.worldTerrainSetHeight(world_id, VecI2(1, 0), next, material_id);
  
   return true;
}
I've modified the "creating terrain" tutorial by adding the following code at the bottom of the "Bool Init" function, and it works correctly.
01-10-2015 01:23 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #9
RE: Merge terrain edges editor interface
Didn't think anything about lerping, that works beautifully. Thank you.
01-10-2015 04:54 PM
Find all posts by this user Quote this message in a reply
Post Reply