Ragash

Members
  • Content Count

    9
  • Joined

  • Last visited

About Ragash

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Rome, Italy
  1. Hi again guys! after messing around a bit with some terrain models i encountered several problem into rendering high detailer heightmap at once (link of working demo, and previus discussion) so i was thinking of dumping the whole testing and try to build a simple "ground composer" from scratch. problem is: how to start? i readed alot about clipmapping, resource consuming, optimizing and vertex morphing, so i though about two possible solution and roadmap: 1) > generating a grid of ground mesh with different subdivision, with fixed position, simulating a clipmap grid, > try to flow heightmap through them as the user input movement. >Camera will be locked on position(i think arccam will suit that) and even the grid itself. 2) > generating a grid of ground mesh with different subdivision > loading new "groundfromheightmap" as the camera approach the border of the "already loaded" tile, > destroying what is leaved back (or even better changing the .visibility to save loading time) at a given range from the camera > updating the one closest to camera to have an increased number of subdivision. 3) > load the whole tile set at once with visibility on false, > rendering only a bunch of them and updating the subdivision accordly on camera position > changing visibility status at given range from camera position and updating the subdivision. those workflows are only causing some headstress to me right now, cause i did not manage to find any reference in Bjs right now, but the early question are: > it is possible to update the subdivision of a groundmesh, or a plane, on request? > It is possible to "stream" heighmap data to mesh (even using shaders)? where i can find documentation? > where shall i find some even not-directly-related documentation to approach what i need? (mostly for working with matrix into Bjs) thanks for any help guys, i think going a bit deep into this argoument will not only help my specific case, but shall provide a series of guideline for the whole comunity because having a big fat playground (even better if not resource hungry) is good for everyone
  2. As said im still a beginer, but i noticed that the generated terrain will not align correctly with the plane and the water lever which had the same dimension (and both generated at the origin). so i tweaked a bit the reposition of the gen mesh to ensure that each "level" will perfectly fit on each other (if you go in wireframe mode and zoom out you will notice better what i mean). anyway im making some build in blender now, i will try to upload the result asap, an see which one will perform better.
  3. Well i modified a bit your script and it work as intendeed: var createCustomGround = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady, heightParts, widthParts) { var ground = new BABYLON.GroundMesh(name, scene); ground._setReady(false); var groundArray = []; for(var w = 0; w < widthParts; ++w) { for(var h = 0; h < heightParts; ++h) { var g = BABYLON.Mesh.CreateGroundFromHeightMap(name, url+"test_x"+ w +"_y"+ h +".png", width/widthParts, height/heightParts, subdivisions >> 0, minHeight, maxHeight, scene, true, function() { g.simplify([ { distance: 300, quality: 0.1 }], false, BABYLON.SimplificationType.QUADRATIC, function() { alert("simplification finished"); }); }); g.parent = ground; g.position.x = -(width/4) + (width / widthParts) * (w) - width/(heightParts*2) g.position.z = -(height) + (height/heightParts) * (heightParts+h) -(height/2.68); groundArray.push(g); } } console.log(subdivisions/(heightParts*widthParts)) ground._setReady(true); if (onReady) { onReady(ground, groundArray); } return ground; };that's the costructor of the custom function, now the call: var ground = createCustomGround("ground", "../../tiles/", 2048, 1368, 250, 0, 50, scene, false, function(ground, groundArray) { console.log(groundArray); }, 4,4);material for now are gone, but i will fix that later, now my concern are mostly in performance. on my old machine i get around 12-10 fps, and i've already tried to apply the LOD to the ground entity, but as "expected" it not work as intended. i'm sorry to not have provided a playground setting, but i've no idea how to provide my custom heightmaps to the scene (however the link into the first post is now updated to the new modifications). suggest? i've looked for a sort of "frustum culling" into babylon,js but did not find nothing unfurtunatly, there are some resource, or example i can use as guide? edit: at this point i start to think that it's "simplier" to create mesh of the terrain directly in blender and then import it into babylon.js...
  4. my bad Raanan, i did not explain it correctly twice what i mean to do after splitting a plane into smaller meshes (what your give script do perfectly) is to use a different image as heighmap for every given tile ground. In fact i wonder, if i can provide a greater resolution image(for example: x0_y0.jpg, x1_y1.jpg and so on...) for every tile (which will have even a bigger number of vertex) the final result will be more smooth and detailed (and even work with the autoLOD feature i think). thanks again for your reply, i will start to make something about it and post it here
  5. that's really close to what im looking for but the point it's to load a different tiled heightmap for each tile of the ground, in that way i could improve the detail for each portion of terrain i will go to generate. thanks you kindly raanan for the code and for your time, i will surely start from that
  6. just a last question, it's possible to load a different height map to every tile of a tiledground? i was thinking modifying the position of the submesh but i've not found any advice for this kind of stuff. thanks again guys
  7. So many thanks for the reply, even if did not used playground! your resolution works like a charm Raanan, so many thanks for the deep explaination: i was already planning to subdivide the big fat plane into a tiled ground, so i (hope it) will take rid of the "distance problem" that let the lod kick in. in this way i will able to offer more "bigger" hightmap and texture (still deciding if mapping one single big diffuse text, or tiling it and streaming with by camera position in some way) and let the LOD get some relief for the tiles that currently are not being displayed. i am right? p.s. As for the "Update", the script is WorldMonger bases, so the base mesh is suitable to be modified after the initial renderting/instantiation, i'm was thinking to let the base heightmap to be updatable to if the future viewer as some special permission. thanks again for your time and your help!
  8. Wow! thanks for the ultra fast reply! i though about creating a scene in playground, but i fear the problem is related to the custom shader of worldmonger, so i doub i will be able to replicate the behaviour (i will try in anycases for sure ) i just messed up with the dimension of the ground generator, swapping the heigmap as asset, and then added the simplify into "index.js" which is the main generator of worldmonger. thanks in anycases for your time, i will try to follow your suggestion ^^
  9. Hi guys and nice to meet you. I've been lurking the forum from a while, im very beginner into WebGL and Babylon.js, and i started studing some terrain modification editing and breaking a bit the demo Worldmonger. i was testing the use of bigger heighmap to generate the terrain, and i was thinking to use the new autolod feature to give relieve visualizing the result on older machine. the problem is when i put a basic simplify, the generated terrain become transparent, as i changed some alpha values. the link of my current demo is here what i'am doing wrong? maybe i forget to change some settings into the WORLDMONGER.groundmaterial? i was thinking to modify the material propriety directly into the callback of the autoLod function, but i've no idea about what insert inside any suggest? thanks for your time guys, this comunity really rocks, i've started messing up with babylon reading you here. have a nice programming