jerome Posted March 22, 2017 Author Share Posted March 22, 2017 I'll complete the last part of the code before the end of the week (hope so). Then I will write the documentation... painful work because, although the API is quite simple, there's much to explain. GameMonetize and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 23, 2017 Author Share Posted March 23, 2017 Maybe I was too optimistic by saying I could finish by the end of this week I just can't have a working function getHeightAt(x ,z) Quote Link to comment Share on other sites More sharing options...
Dal Posted March 23, 2017 Share Posted March 23, 2017 54 minutes ago, jerome said: Maybe I was too optimistic by saying I could finish by the end of this week I just can't have a working function getHeightAt(x ,z) Keep at it! Terrain is a tricky topic but you're smart so I'm sure you will get it Could you make an example with the terrain view distance of about 1km? I'd love to see how this performs on larger scenes. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 24, 2017 Author Share Posted March 24, 2017 What would a terrain be without some collision detection features ? Here's the first working prototype of terrain.getHeightFromMap(x ,z) in action : http://jerome.bousquie.fr/BJS/test/terrain.html Not yet documented (*), but already working : https://github.com/BabylonJS/Extensions/tree/master/DynamicTerrain/dist (*) Actually all the methods are documented in code comments, so if you generate a doc from the code, you can already get the API documentation. adam, JohnK, GameMonetize and 1 other 4 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 27, 2017 Author Share Posted March 27, 2017 Hi guys, Today's extension repo update is a complete reimplementation of the internal geometry update, faster than the standard ribbon update because it deals only with low level float32 arrays directly instead of BJS objects (vectors3, colors4, etc) and it embbeds within the same loop the terrain computation, the mesh geometry computation and its bounding box computation. So one loop instead of three. The legacy ribbon object, provided in the BJS core, was also a bit improved to morph quickly, GC and optimizer-wise. Well, I still need to add two or three more little and useful methods for the user, like returning the terrain normal at the coordinates (x, z) or a boolean to check if the world coordinates (x, z) are currently also in the terrain (both almost done), before starting to write some documentation and code some examples. The toy will be released very soon winkman and adam 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 28, 2017 Author Share Posted March 28, 2017 first version completed and on-line : https://github.com/BabylonJS/Extensions/tree/master/DynamicTerrain now it's doc writing and example coding time for me ... NasimiAsl, Dad72, JohnK and 3 others 6 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 28, 2017 Share Posted March 28, 2017 The best part NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 28, 2017 Author Share Posted March 28, 2017 aaarg NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 29, 2017 Author Share Posted March 29, 2017 doc started : https://github.com/BabylonJS/Extensions/blob/master/DynamicTerrain/documentation/dynamicTerrainDocumentation.md GameMonetize, NasimiAsl, Boz and 2 others 5 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 30, 2017 Author Share Posted March 30, 2017 some first examples to understand the terrain : https://github.com/BabylonJS/Extensions/blob/master/DynamicTerrain/documentation/dynamicTerrainDocumentation.md adam and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 31, 2017 Author Share Posted March 31, 2017 doc half done at this time same URL GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted April 3, 2017 Author Share Posted April 3, 2017 more doc again and more examples : https://github.com/BabylonJS/Extensions/blob/master/DynamicTerrain/documentation/dynamicTerrainDocumentation.md Still in progress but already usable/readable GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted April 7, 2017 Share Posted April 7, 2017 Cool! I started experimenting with this, but I think I still not get LODLimits. I would like a terrain like this: - near, lod 0, 128x128 meters, 0.5m/texel (the resolution of the heightmap, and the material splatmap. 256x256 quads) - far, lod 1 1024x1024 meters, 4m/texel (this is like 1/8 resolution. 256x256 quads) - environment (mountains), lod 2 10240x10240 meters, 20m/texel (1/40 resolution. 512x512 quads) Edit: It can be 1/32 resolution, it does not matter really. How can I do this? Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted April 7, 2017 Share Posted April 7, 2017 the full height map would be 20480x20480, and that's about 3.4G in memory (just the heightmap), so that's impossible to download and have in memory. I'm thinking of some kind of patch loading. Now I'm using two groundheightmaps, one is 10kmx10km 512x512, one is 1280x1280m 256x256. Quote Link to comment Share on other sites More sharing options...
jerome Posted April 7, 2017 Author Share Posted April 7, 2017 I'm off this next week, I'll tell you when I'm back The main idea is this one : the initial LOD is the factor between the terrain quads and the map quads => 1 (default) means 1 terrain quad matches 1 map quad 2 means 1 terrain quad matches 2 map quads on X axis and 2 map quads on Z axis, so 4 map quads 3 means 1 terrain quad matches 9 (3 x 3) map quads, and so on When you set a LODLimit, this means that the terrain quads under this limit around the terrain perimeter have their LOD factor incremented LODLimits = [2] => consider the 2 rows and columns of quads around the terrain... they have their LOD factor equal incremented from the initial one. If the initial LOD is 1 (default), their LOD factor is 2... In this case, the central terrain quads match each 1 map quad and the perimetric terrain quad (under 2 rows/columns) match each 4 (2 x 2) map quads. Maybe this picture can help to understand : In this example, the LODLimits is visibly [6, 4]. Have a look only at the squared quads from one terrain corner. 6 quads from the edge in totla have a LOD factor higher than the central ones and from these 6, 4 have again a LOD higher The terrain doesn't know any measurement but only map quads. It can fit 1, 4, 9, 16, etc map quads (for the squared quads, the others are automatically computed) HeadClot 1 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.