Tag Info

Hot answers tagged

50

To generate a voxel terrain (a) A common method is to generate a heightmap using Perlin noise. A heightmap is basically a monochrome image representing different heights by the darkness or lightness of its pixels. You'll look at individual pixels in this heightmap to create "stacks" of voxels up to different heights (z-axis) in different (x,y) locations, ...


27

The best way to generate interesting voxel terrain is with a Perlin noise density map. Rather than using a 2D Perlin noise map defining the height of a 3D world, use a 3D Perlin noise map. Weight the map so that the values closer to the bottom will be more likely solid, and the values closer to the top will definitely be air. This gives your world height, ...


25

Heightmaps With a heightmap, you store only the height component for each vertex (usually as 2D texture) and provide position and resolution only once for the whole quad. The landscape geometry is generated each frame using the geometry shader or hardware tessellation. Heightmaps are the fastest way to store landscape data for collision detection. Pros: ...


24

For a 'classic' 3D terrain editor, the steps could be those: Generate a mesh (e.g a grid of squares, every square made of two triangles), all vertices are shared between triangles (so that there is only one normal per intersection). This should be made a 3DMesh and rendered in your program. Make a tool to raise and lower (smaller and bigger) parts of the ...


17

If you're looking for a rendering engine that does all of that first list right out of the box, I don't think you'll find a whole lot. Stuff like fancy lighting shaders and day/night stuff are very game/simulation specific, and most rendering engines either won't have that sort of thing built in, or the built in implementation won't meet your specific needs. ...


16

I assume that although your tile positions are defined in integers, your camera position may not be. So if you are trying to render pixel-perfect positions from a non-pixel-perfect position then the sampling may be off and cause lines between the tiles. In your SpriteBatch.Draw calls, I would suggesting changing the SamplerState to PointClamp to ensure that ...


15

I've recently implemented an algorithm for a procedural city layout. It's still very much a work in progress, but seems promising to me. Take a look: The algorithm used to create this layout is loosely based on L-Systems. I have a base Element class, that has a rectangle marking its place on map and a method Grow, which creates other Elements inside the ...


15

How about simply not permitting this situation? I don't know how you are making your game, but if you detect that the view will be partly underwater, you can force the camera to be above water, and only when the entire view would be below water, you can switch to the underwater view. Depending on how you do it, this could mean that there is an additional ...


14

You should definitely check out the Halo Wars GDC presentation, "The Terrain of Next-Gen." It discusses using full vector field displacement instead of simple height field displacement. For something a little less revolutionary, maybe check into geometry clipmaps. There's a good article in GPU Gems 2 here.


13

Split the terrain into square "chunks", load those you care about (mostly: Those near the currently active camera) in Update() and - if you are strapped for space (you likely will be), unload the not needed ones far away. Use pre-calculated low-poly models for far-away terrain LoD, unless you don't mind having a low view distance. Also, if you need the ...


13

In using the word connectedness, you've come within a hair's breadth of the tool best suited to determining a solution: graph theory. Connectedness is a property of graphs. Graphs can be either connected or disconnected (as you're experiencing, AKA a multigraph). Any game level, in any number of dimensions, can be represented as a graph, and logically, this ...


12

I imagine if I was going to build such a shader there are certain phenomenas that I will start with. First the sunlight is directional, meaning it does't have position nor attenuation. Second the diffuse component is simply calculated by taking a dot product between the sun direction and the surface normals, adding normal mapping might add to the detail. ...


10

D3D9 is quite different from an API perspective than D3D10, but the underlying concepts are very similar. Any terrain rendering example in D3D9 (such as this one) will work fine in D3D10, you'll just have to translate the API calls which shouldn't be that difficult. Similarly, since the techniques for rendering terrain are in no way API-specific, you could ...


10

ROAM stands for "Real-time Optimally Adapting Meshes." It is a level of detail algorithm for rendering large terrains. It's somewhat complicated so I'll link to some more in depth explanations: Here is the paper: https://graphics.llnl.gov/ROAM/roam.pdf The following is a slightly less academic explanation: ...


10

Create a triangle strip. You could have your random heights at intervals equal to t. So the triangle strip would then consist of you alternating between the height vertices (with y being random and x equal to t * iteration) and vertices that go along the bottom (with y being constant and x also equal to t * iteration). Naturaly, the distance between each ...


9

For one, the geometry pipeline needs to be as simple as possible and just push geometry to the GPU with quite basic LOD management on it. I did a presentation at Siggraph 2007 titled Terrain Rendering in Frostbite using Procedural Shader Splatting which goes into some detail of how we handle both the geometry LOD and the general texture and shading of the ...


8

I'd like to point out that none of the terms you mentioned are mutually exclusive with each other - you could even have a voxel based game that used heightmaps and rendered using polygons. Height-maps are two-dimensional representations of the height of the ground at each specific point. They are often stored as greyscale images, where the brightness ...


8

You can easily have coordinates going into the millions on units with an int. You can go all the way up to 2,147,483,647 units in the positive or negative direction. Procedurally generated worlds are not actually infinite. They're just very very big. If you think that 2 billion isn't enough, use a long to store your chunk coordinates, then you can go up to ...


7

You should stream your terrain from disk; don't load the entire world into memory just to render what's around the player. Also see "What’s the newest trend / method for terrain rendering?" and "What is 'ROAM' related to terrain rendering?". Traditionally, a heightmap grid of tiles has been used to represent the terrain geometry. However it doesn't allow ...


7

I don't know if the answer you are looking for exists, but personally I don't like the idea of independently generating values that you hope will end up identical. I'm assuming that the map data is something you only generate once in the beginning of the scene. If so, much better to generate the data once, and use it twice. You should either generate the ...


7

It looks like any regular 3D model. The only thing that's "2.5D" about it is the fixed camera and play space.


6

There's this GDC talk on procedural building generation from a couple of years ago. It's for creating individual buildings based on a set of templates, but not for creating whole cities (laying out streets and so forth). There isn't any free code to go with it, unfortunately. The system described in the talk is implemented in Unreal although I'm not clear ...


6

The first thing is to be clear on the data structure of your terrain, and what you want from an editor. Is it a mesh? An array of heights? Some sort of Minecraft-style voxel system? Do you need to be able to add mesh terrain features like trees and buildings? Manually, automatically or both? I could go on, but you get the idea. A basic terrain editor ...


6

You can accomplish this with UV mapping. Most likely they generated 2 "layers" of geometry. One for the grass, and one for the dirt. The "dirt" strip lies below and has texture-coordinates that accumulate horizontally. As long as the dirt texture is tileable, it will nicely repeat. The goal here is to have no distortion. For the "grass layer", I would ...


6

Finally, after a lot of researching I can conclude that, as some one said before, There is not universally "best" method. But my research led me to the knowledge of the following things: Depending on the mesh you will finally use: Spherified Cube: any LOD method with quadtree implementation will work just fine, you just have to take care on special cases ...


6

The problem you are referring to has to do with the camera's view volume clipping through the water plane; typical "underwater effects" are done via full-screen post-process effects, and wouldn't look correct if the view is clipped like this (it would just be the opposite problem). Even if you do bother to detect the clipping case (potentially difficult) ...


5

I think the best Idea is to go with the real time generation since there are always some nerds who break every limit you put for yuor game. for example if you go with 5000 nodes there will be some people to player far past it just like what happen to pacman, none of the developers never tought of someone go beyond level 255, but there were geeks to break ...


5

You should end your spriteBatch before doing any 3d drawing. Always keep 2d and 3d drawing separate. By the way, why are you even beginning & ending the spritebatch if you're not drawing any 2d? Within a spritbatch begin/end, XNA sets various renderstates for 2d drawing. Often these aren't best for 3d drawing... especially if you're using XNA 3.1. In ...


5

The easiest way I can think of is simply adjusting the threshold parameter, a smaller value would result in thicker walls, while a higher value would result in thinner walls (or vice versa, depending on your threshold test)


5

No, not really. If you are thinking of using a quadtree for terrain level-of-detail, the nodes you store will all usually possess the same data structure. In your example, that structure is a 33×33 submesh that the nodes will hold. Depending on the level of the node, that 33×33 mesh will adapt (adaptive) to cover a wider area. The larger node will fill a ...



Only top voted, non community-wiki answers of a minimum length are eligible