Jump to content

  • Log In with Google      Sign In   
  • Create Account

JTippetts

Member Since 04 Jul 2003
Offline Last Active Today, 12:18 PM

Posts I've Made

In Topic: directx volume terrain

27 April 2016 - 02:45 PM

Wow, nice idea.  Maybe i dont have to recalculate all triangles but I still have to create dynamic buffer for each chunk :/


Probably, yes.
 

And I need to store a lot of volume data. What is the best way to increse speed? Binary files?


Well, binary files are usually more quickly loaded than text files, yes. Other than that, you'll need to profile to find where your bottlenecks are, and try to apply optimizations as needed.

In Topic: directx volume terrain

27 April 2016 - 12:45 PM

You will need to recalculate triangles only when a value is changed. You can also reduce the amount of recalculation that is performed by splitting your volume up into 'chunks', where each chunk is some arbitrary dimension of cells, and running marching cubes on a per-chunk basis. Then you only need to regenerate the chunks that are actually affected by the edit, rather than the entire landscape mesh.

In Topic: directx volume terrain

27 April 2016 - 08:54 AM

If you store your terrain as a 3D grid of values, then you can edit the terrain by changing the value stored at a particular location. You can generate your mesh using marching cubes, using the 3D grid as the density function. Each cell of the 3D grid would be interpreted as a corner point for a set of cubes. Editing operations could be either binary (set a particular array location to either 1 or 0) or smooth (add or subtract a small increment). Smooth editing would result in smoother mesh generation.

As for isolevel, you just pretty much determine what you want that to be when you start. Set it at, say, 0.5 and then you don't usually change that again. That's simply the arbitrarily-chosen value of where you locate your iso surface.

In Topic: directx volume terrain

26 April 2016 - 12:09 PM

Yes and I read http://paulbourke.net/geometry/polygonise/
 
but I cant imagine how it exacly works :/
 
Any examples in directx?
 
Marching cube is this black cube on video, but what is isosurface?


The black cube in the video is not "marching cube". That's just the guy's editing cursor, a visual marker to show the location he's looking at to edit.

Marching cube is an algorithm, or set of steps, that can convert a density field function to a mesh.

An isosurface can be described as the set of all points where the density function is equal to some value, this value being the "isolevel".

To start with, you need to understand that your volume terrain is going to basically be a mathematical function that for some input (x,y,z) will return a value, or density, at that location. This output value is typically a floating point value in the range of 0 to 1. So any given coordinate location within the bounds of your world or level will have a corresponding density value. The iso-level parameter determines where the boundary between "solid" and "open" lies. If you set iso-level to 0.5, then any (x,y,z) location whose density value is less than or equal to 0.5 is considered "solid", while everywhere else is considered open.

The tricky part in this type of thing is generating a mesh that follows the iso-surface of the density function at the threshold of iso-level. The Marching Cubes algorithm is one such technique. It operates by splitting the volume up into discrete cubical cells, and evaluating the density function at each corner of each cell. Cells where some of the points are "solid" and others are "open" are considered to be parts of the iso-surface, and the algorithm will generate a small bit of mesh geometry for this cell, representing a divide between the solid and open cells. Once all surface cells are evaluated, the resulting pieces of geometry are consolidated to form the surface mesh of the volume.

The term "marching cubes" comes from the mental metaphor of cubes "marching" across the surface of the volume, since an optimization in the algorithm includes starting at a known surface cell and recursing out to neighbors of that cell that are ALSO surface cells.

In Topic: Computers will grow food in the future

25 April 2016 - 04:05 PM

C'mon people, don't tell me you have been corrupted by the modern culture of convenience, that much. I was hoping people would show some interest through initiative.
 
Don't be lazy. What's so vague about the details I provided?
 
Sound like my beer buddies when I tell them something that they didn't know about first. "Pfft, that's old news. Didn't you already know about that?"
 
:lol:



Well, all you really did was start a vague thread, "some guy said this somewhere on the internet." Didn't even bother to spend so much as a word on your own thoughts, criticisms, etc... Just, "hey guys, this one guy said this one thing." And you call everyone else lazy? Damn, son.

PARTNERS