Ragash Posted February 11, 2015 Share Posted February 11, 2015 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 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 10, 2015 Share Posted March 10, 2015 Hi Ragash... good to hear from you again! Well, it's been about a month, and no replies. Sorry about that. In my opinion, you bet. I agree. It seems that we should have a wiki document that is ONLY about ground/heightMaps. It is a super-important part of almost every scene. #1 > it is possible to update the subdivision of a groundmesh, or a plane, on request?#2 > It is possible to "stream" heighmap data to mesh (even using shaders)? where i can find documentation?#3 > where shall i find some even not-directly-related documentation to approach what i need? (mostly for working with matrix into Bjs) #1 - Yes. But changing the number of subdivisions... is more difficult. If you only want to change the height of ground vertices (and maybe color/texture)... not a problem. Almost every mesh (even ground) has a VertexData object associated with it. You can call methods on IT, or call methods on Mesh that update IT. For example, the Mesh class has a method called .getVerticesData(kind). var myPositions = mesh.getVerticesData("position") -> an array of x,y,z position values. Then adjust or replace the values, and put it back onto an updateable mesh with... mesh.setVerticesData("position", myPositions) The same methods are used to set a mesh's colors, indices, uvs, etc. Easy, eh? We also have a few other toys, like mesh.applyDisplacementMap() and mesh.applyDisplaceMapFromBuffer(), all good things to experiment-with.----------------------------------- #2. Good question. I think SOME people are using a ground TILE system. New tiles are loaded on-demand, but I'm not sure what constitutes a "stream" and what is a "load". I'm too inexperienced to answer this question. Maybe experts will reply.----------------------------------- #3. Well, we have the basic heightMap tutorial, but that is not geared toward dynamic updating of ground/mesh. I think you should take a look at the Tiled Ground tutorial. It might address some of your thoughts/ideas. Getting data TO the scene... from a server (such as Node.js server)... is really not on-topic for this forum, but maybe you can meet people who are doing such things. The BJS framework definitely has the tools to update mesh with fresh data. If you can get the data to the client, BJS can apply it to a mesh. And, the ways to install that data... are already built-into the Mesh class. Maybe YOU will be the one to write... "Manipulating BJS Groundmesh - The Ultimate Guide" We are also looking for heightMap experts to update our heightMaps... in a way that honors the newest Cannon.js physics engine... heightMap imposter feature. The person who does that update... will become an instant BJS superhero. Ready? I hope I was able to address SOME of your questions and concerns. Let's hope experts will add more/better information. Again, sorry it took so long for a reply. I think heightMaps are an interesting subject... and as you have stated, they are quite important to games. I think the "best ways" to communicate between a server and a scene heightMap... are still being investigated and discovered. But I know very little about that subject. 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.