Volumes Of Fun

Procedural Terrain Engine
Page 2 of 2

Author:  drwbns [ Fri Jan 13, 2012 6:48 pm ]
Post subject:  Re: Procedural Terrain Engine

I wanted to make sure you didn't miss my post here -


I got some build errors(unresolved symbols) in VS 2010 for some reason, even though they are plainly defined in the PolyVox library, I was hoping you could help me

Author:  GM_Riscvul [ Fri Jan 13, 2012 8:49 pm ]
Post subject:  Re: Procedural Terrain Engine

This could be because you are using the current GIT version instead of the Snapshot specified in my ReadME. What version of Polyvox are you using?

I would like to get this running for everyone, so feel free to ask questions about any problems or code that confuses you.

Also on a side note the LOOOONNNNG load time of the program is due to a massive pre-fetching operation I perform in order to make testing faster. My generation algorithm is very slow (but detailed) and needs improving in order to provide real-time performance.

Author:  drwbns [ Sat Jan 14, 2012 1:30 pm ]
Post subject:  Re: Procedural Terrain Engine

I'm using version http://www.volumesoffun.com/polyvox/sna ... e4bf67.zip which says it's the dec 11th snapshot which I got from http://www.volumesoffun.com/polyvox-download/

Author:  GM_Riscvul [ Sat Jan 14, 2012 5:25 pm ]
Post subject:  Re: Procedural Terrain Engine

Ok you are using the right snapshot then. Could you post the unresolved symbols you are encountering?

Also if you are having compile errors how did you produce the screenshots you posted?

Third, did switching over to OpenGL solve your shader compile issues? Are you seeing the crappy green grass texture over everything now?

Lastly on the SceneNode error. I have the world split into 32^3 voxel regions. Each region is extracted from polyvox and placed into a ManualObject which is placed into its own sceneNode. The name of the Scenenode is determined by the dividing the coordinates by 32 and taking the floor. This gives every object a unique name which Ogre requires. The list of loaded chunks is stored in the variable mMeshList inside of MeshManager. A constant variable determines how large this list can be.
When another mesh is being added once the list reaches its max, the last updated mesh is removed from the list. Unfortunatly the time to generate chunks is so slow that if you move away from the pre-fetched (generated at the start - long load time) landscape then you can easily overload the mesh list before the chunks start appearing. If the mesh is kicked off the list before its mesh is generated then you will get this error.

I have an alternative noise library that I want to try to see if it will be faster, otherwise I need to optimize my generation code and try to eliminate some of the fractals I am using in order to speed up generation so this doesn't happen. If you have any suggestions on how to speed up the generation let me know.

Also if you only want landscape you can remove the cave generation code in Generator.h to obtain massive speed benefits to generation.

However as I mentioned earlier this is only fatal if you don't catch the error. Simply add some try catch blocks around the scenenode manipulations and you can keep running without crashing. You just might have to re approach the region in order to generate it.

Author:  drwbns [ Sat Jan 14, 2012 6:43 pm ]
Post subject:  Re: Procedural Terrain Engine

ok thanks for the info. and I fixed the compile errors as I stated in the other thread, but I guess you missed it. -

I solved the linking errors by rebuilding PolyVox with vs 2010 instead of 2008. But I hit an Ogre error while running the app saying it could not find SceneNode xyz ... any ideas?

I was trying to use the polyvox lib built with 2008 in vs 2010(worldcraft project). Which reminds me - Worldcraft was the name used by Valve's first map editor, you may want to check if their copyright exists, but they changed the name to Valve Hammer editor around the time Source engine came out, maybe before.

Also, switching to OpenGL solved the shader problems - I see the crappy grass texture :)

Author:  drwbns [ Sat Jan 14, 2012 7:07 pm ]
Post subject:  Re: Procedural Terrain Engine

I tried taking out the cave generation code, but when I ran the app, nothing happens - just the render, but no generation of any kind.

Author:  GM_Riscvul [ Sat Jan 14, 2012 10:26 pm ]
Post subject:  Re: Procedural Terrain Engine

I believe you didn't notice how the select worked.

This section:

   inline double getMaterial(int x, int y, int z)
      return groundCaveMultiply->get(x / -128.0, y / -128.0, z / -128.0);

Should be changed to:

   inline double getMaterial(int x, int y, int z)
      return groundSelect->get(x / -128.0, y / -128.0, z / -128.0);

Otherwise it tries to pull values from the cavedata which no longer exists.

Hope that helps, Let me know if you find ways to improve it, I would love to make it better.

Author:  drwbns [ Sun Jan 15, 2012 6:15 pm ]
Post subject:  Re: Procedural Terrain Engine

Ok I took out the cave generation and I'm looking at the code that deals with the mMeshPool variable. Thanks. Why does it seem as though the terrain generation stops at random intevals and does nothing? How can I tell the mesh manager to build and display the entire terrain? Also, what is this shader in the picture ?

screenshot01152012_102037454.gif [ 25.78 KiB | Viewed 8784 times ]

Author:  GM_Riscvul [ Mon Jan 16, 2012 3:44 am ]
Post subject:  Re: Procedural Terrain Engine

I'm sorry for the issues, but it is an alpha at best.

As far as the stops, I guess its because it is generating below ground segments and/or above ground segments and you can't see the work its currently doing. It could also be because you are wandering from the pre-fetched terrain section and the generation speed drops sharply outside this region.

As far as the entire terrain, this program is designed to produce infinite terrain, there is no way to show all of the land at once. However to increase the view size you can modify the variable mViewRadius in WorldManager.h in order to increase how far away chunks are loaded from the camera position. You can also modify the code which loads chunks to load a set group of chunks at the beginning if you want a specific sized world. Then update those chunks only when you edit them rather then basing it on camera movement as I have.

Lastly that shader is actually some sort of error from the SkyX library. It should be possible to fix this error by changing the settings of SkyX, I haven't had time to experiment with this so I don't know yet, but I believe my max atmosphere height is too low and min too high causing some sunlight effects to have some issues with my textures. I also might have connected SkyX improperly. You can remove SkyX if you want, it only provides the sky. Eventually I will have sun, moon, clouds, and weather implemented using this library. For now it doesn't really do anything but static clouds.

Also one last note. I designed this terrain to be viewed at a fairly close distance. You might want to change variables affecting the scale of the terrain if you plan on it being viewed from as high as all your screenshots indicate.

Anyway keep the questions coming, and hopefully I'll have time to address these issues soon. I'm currently working on another project so I've had little time to get back to this one.

Page 2 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group