It is currently Sat Aug 22, 2020 3:40 am


All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Procedural Terrain Engine
PostPosted: Fri Jan 13, 2012 6:48 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
I wanted to make sure you didn't miss my post here -

http://www.volumesoffun.com/phpBB3/viewtopic.php?p=2491#p2491

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


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Fri Jan 13, 2012 8:49 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
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.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sat Jan 14, 2012 1:30 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
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/


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sat Jan 14, 2012 5:25 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
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.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sat Jan 14, 2012 6:43 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
ok thanks for the info. and I fixed the compile errors as I stated in the other thread, but I guess you missed it. -

Quote:
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 :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sat Jan 14, 2012 7:07 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sat Jan 14, 2012 10:26 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
I believe you didn't notice how the select worked.

This section:

Code:
   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:

Code:
   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.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Sun Jan 15, 2012 6:15 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
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 ?


Attachments:
screenshot01152012_102037454.gif
screenshot01152012_102037454.gif [ 25.78 KiB | Viewed 9297 times ]
Top
Offline Profile  
Reply with quote  
 Post subject: Re: Procedural Terrain Engine
PostPosted: Mon Jan 16, 2012 3:44 am 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
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.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net