Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Procedural Terrain Mesh Generation?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Mythics   Members   -  Reputation: 135

Like
0Likes
Like

Posted 02 July 2012 - 10:21 AM

Hello all,

I'm working on a game of sorts using mostly cubes (fairly minecraft-like).

I'm currently using 3D Perlin Noise with some custom tweaks to generate the terrain which works out fantastic, but I'm not quite sure how I should be going about rendering it in the best manner possible.

I definitely don't want to be over optimizing, but with the level of detail I'm going for, it's quite possible to have several million 'cube' faces visible at once. Instancing of individual faces certainly isn't desired in this case due to the expense there (tried it, obviously failed miserably due to the heavy amount of real time computations needed to translate/texture/etc).

So, my goal at the moment is to create some form of surface extraction algorithm. Rather than recreate the wheel, what might be out there to accomplish this simple task?

I'm obviously not just wanting to create a generic mesh with two triangles per every face, but slim down on those triangles when multiple faces are joined together on the same plane.

Any help, tutorial links, code, etc would be appreciated.

Edit: Thought I better specify, I'm using C# with XNA 4.0. I should be able to port most anything over though, but I'm sure someone has already done this in C# (xna shouldn't be terribly relevant I wouldn't think).

Thanks,
Mythics

Edited by Mythics, 02 July 2012 - 10:29 AM.


Sponsor:

#2 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 02 July 2012 - 01:03 PM

You can make a simple type of raytracing by storing the world compressed in a texture. HLSL with Shader model 4.0 and later have the "Load" and "GetDimensions" methods that makes it easy to read any type of information encoded in a texture.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#3 jefferytitan   Crossbones+   -  Reputation: 2226

Like
0Likes
Like

Posted 02 July 2012 - 05:09 PM

Hmm, I don't know a specific way, but one good way to start might be looking for neighbouring triangles with matching normals and shared vertices. You could go for a simple greedy algorithm, e.g. look for a triangle with a co-planar triangle strip along one edge, make it into a bigger triangle, repeat. However I do seem to recall that you can get graphics or physics issues if you have a large triangle sharing an edge with many small triangles.

See if the below helps:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Surface_mesh_simplification/Chapter_main.html




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS