Dal Posted February 9, 2016 Share Posted February 9, 2016 Just a little preview of something I am working on... an infinite deformable voxel terrain. Still lots to fix for now though... I need to move the noise processing into a web worker which I'm finding tricky and for some reason the part of the terrain that starts behind the camera seems to be in eternal darkness It does run at 60fps and 4k resolution on my machine, but it has some nasty slowdowns when loading new chunks and my guess is it won't run too well on slow machines yet. I am also struggling to get nice shadows on the terrain... I guess we need CSM to do this properly because the terrain is so large. iiceman, adam and Wingnut 3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 9, 2016 Share Posted February 9, 2016 Wooot! Would love to try it Quote Link to comment Share on other sites More sharing options...
Dal Posted February 9, 2016 Author Share Posted February 9, 2016 34 minutes ago, Deltakosh said: Wooot! Would love to try it Soon! Right now I have implemented workers, but the terrain is loading multiple times because the rest of my code isn't thread safe @Deltakosh Any idea how long before we can have CSM shadows? Maybe it could be something worked on for 2.4? adam 1 Quote Link to comment Share on other sites More sharing options...
Dal Posted February 18, 2016 Author Share Posted February 18, 2016 A little update... I've completely replaced the meshing algorithm, so instead of dual marching cubes its now using naive surface nets. That has dramatically improved the performance so I can now render right into the far distance and still run at 60fps. I'm thinking of replacing the material shader - at the moment I'm using the triplanar material from the materials library but it seems to have some problems (at least in my usage case). After that, the next step is to make the terrain deformable. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 18, 2016 Share Posted February 18, 2016 Ok, so, teach us stuff, Dal! Hmm. (thanks for blazing trails with BabylonJS, by the way). Umm... so a "voxel"... is like a cubical tower... with a potentially-angled top face? Is a voxel top face always 2 triangles? Or can a voxel top be 8 triangles (4 squares)? 12 triangles? 16? Or are 8, 12, 16 considered a "herd" of voxels? A covey? A flock? Floxels? And, umm, what the heck is smoothing your landscape (first picture) so nicely? A shader? It's not blocky at all, but it looks a little "smeary". Still cool. Anyway, it's not your job to teach us about voxels. I read a bit about the pros and cons... and it sure sounds like a method that has plenty of applications. Procedural, eh? (abils to be infinite). Nice. That could be done with standard tri-mesh, too, though, I suspect. You sound like you know what you're doing, Dal. I bet you will do procedural grounds of BOTH kind, eh? (beg beg) heh. Cool project, Dal. As far as Cascaded Shadow Maps (I looked it up for the youngsters)... be patient. The delay is usually good news. It might mean that "the big dogs" are looking at CSM and making evil plans to implement it. But maybe not. Good luck on your project.. keep us posted. Boz 1 Quote Link to comment Share on other sites More sharing options...
Dal Posted February 18, 2016 Author Share Posted February 18, 2016 It works in much the same way as the minecraft-style cube voxels, but instead of just drawing triangles to represent the faces of each cube (each square face being made up of 2 right-angled triangles) it instead uses a clever formula to work out how much of the surface passes through the cube and draws only the polygons for the point where we cross from air to solid. This blog explains it better than I ever could: http://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/ I'm no mathematician - I didn't invent the system, I just did some research into the different methods and read some papers, and I found Mikola Lysenko's nice blog. He presents his own method (so its not patented) and some MIT licensed sample code there in javascript which I've modified and integrated with BABYLON. The terrain painting is done using the triplanar shader from the Babylon materials library, although I am having issues with it painting the area that starts behind the camera in complete blackness... I haven't yet figured out what causes that. This currently uses perlin noise to generate the terrain and it is chunked, so it's fully infinite, Things on my todo list for this ( they might not all happen) - Better noise (more natural terrain) - Collision and picking - In theory this might already work, as I've extended GroundMesh but I need to check it. - Editing (digging holes, raise, lower, flattening, maybe some erosion tools) - Heightmap loading - I'd like to be able to use a heightmap as well as noise to get a more natural look. - Moving the loading of new chunks to a worker thread (already partly done) - Better material... I might need a more advanced triplanar shader. - Biomes - I'd like to be able to have grassland, snow, desert etc. regions that blend together. - Saving - I want to be able to save the edits to the terrain so that the world is persistent. Things I am hoping others will work on to make this look good in the end: - CSM shadows - Better outdoor lighting.. maybe some sort of global illumination - Better SSAO - the current one causes a textile effect and is VERY slow. I think @Luaacro is planning something for that. - Better other post effects. Most of the ones we have seem to be unacceptably slow in large open world scenes. I'm hoping we'll see speed improvements as the engine matures and people can implement more advanced post shaders in the longer term now that we can use WebGL 2.0 features. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted February 19, 2016 Share Posted February 19, 2016 Yes, I assume that I'm working on the textile effect. Concerning the computation speed of SSAO, I don't know if I'll be able to improve it Quote Link to comment Share on other sites More sharing options...
Dal Posted March 4, 2016 Author Share Posted March 4, 2016 A little update... I've implemented Dual Contouring now, and it can do shape intersections to create tunnels and such. Still needs a lot of work though. I can't believe I have been working a month on this already lol. aWeirdo, Wingnut, GameMonetize and 1 other 4 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.