19

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


18

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


16

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

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


14

This is achieved by interpolating ramps between cubes of different height. When you have a scenery like this (seen from the side) # #### ## ############ you would add polygons to make it look like this: /#\ /####\ /##\ ############ An algorithm to calculate these ramps is the marching cubes algorithm. When you want it to be even more beautiful, ...


11

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

Other answers here suggest using a texture. Here's a technique that doesn't use textures. You want the boundaries between hexagons to be interesting. It's easier to make interesting boundaries when you move them into the center of what you're drawing. Instead of drawing the tiles directly, you draw the “dual” of the tile. This technique is called “corner ...


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 9....


8

You can accomplish this with bitmasking. Each tile determines if it is an edge tile, based on its neighboring tiles. From the image above, we would assign a value to each neighbor. 1, 2, 4, or 8 based on its location. If the neighbor is a different tile Type than the one in the middle, you add the corresponding value. These values map out as shown in ...


8

It is not simply Marching Cubes With marching cubes, a block would expand into the surrounding ones. In fact, with the default configurations for the Marching Cubes algorithm the result is a Rhombicuboctahedron, depicted below. That is the result of considering all the eight vertices of a cubic block set as input for the marching cubes algorithm. It is ...


7

You might want to look into fur shading technique. This is what I would use for this type of grass, since the shorter the grass is the better the performance (less layers). Basically it works by layering the same surface multiple times in small increments: You can also change the horizontal offset to make the grass look bent.


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

There are two obstacles you need to deal with in order to achieve similar quality like the one in the image, the first is artistic and the second is technical (memory, processing). First I assume that you already solved your artistic problem, you can make the models, the art and the shaders etc. (Partially because I can't answer art problems) The major ...


6

The bulk of Minecraft's chunk rendering goes through a vertex array. The world is split into 16x16x16-block render-chunks (which currently happen to be the same as storage-chunks, but it wasn't always that way). Each render-chunk is converted to a vertex array, and rendered. It uses OpenGL display lists (one per render-chunk) as an older alternative to VBOs....


6

I have little experience using Unity directly, but I've been a level designer for years and a much easier approach rather than worrying about cutting holes into your terrain is to simply build up a C shaped ridge in your terrain for the size of your cave and then cover it with rock meshes to give it the illusion of a cave. Another approach is that you ...


6

If you select your terrain and go to the last tab which is settings you will see a slider called 'pixel error'. That determines the accuracy of the mapping between the terrain maps and generated terrain. The higher the value, the lower the accuracy and rendering. The default should be about 5 which is why your number of tris is so high. Increasing this ...


5

Multi-texturing. Add a weight to each texture by adding extra texcoords in a shader to your vertex declaration. You haven't supplied what language you'd like this in (or even whether it's a programming question, but that's an assumption on my part), but Riemers provides a good tutorial using C# and XNA and also explains the concept here.


5

From what I can tell there are two major requirements for your terrain that Marching Cubes (MC) simply cannot fulfill: Sharp edge rendering Chunked LOD I'd recommend the Dual Contouring (DC) algorithm, which handles both cases quite gracefully, and as a bonus is able to optimize chunks with fewer features to use fewer triangles. There is an often-cited ...


4

One of Python's huge weaknesses is the existence of a global interpreter lock. Essentially all python code is executed while holding this lock. The consequence is that multi-threaded python applications are effectively incapable of parallelism. Threads allow the convenience of a multi-threaded programming model, but multi-threaded python applications will ...


4

Have a matrix of chunks that make up the visible area around the camera. The chunks will use modulo, just like in 2D, to determine which chunk of your wrapped 3D world they should contain. Each dimension is like a conveyor belt, loading and unloading chunks as the camera moves along its axis. Now, when it comes to drawing, you just reference the chunks ...


4

Given credit to Alan Wolfe for what he said on "INFINITELY tile". A 2d perlin noise (or a 2d simple noise) will have no seam problem as far as you stay away from noise borders (defined by floatin point dimenision) Referencing the image: and said that you have chunks with 128X128 vertex, in chunk i,j you compute each vertex as : for x : 0 .. 128-1 for y : ...


4

Start generation early; if a player gets within 3 screen widths of the edge of the generated map start generating more chunks on that edge 1 chunk at a time. Focus generation on the area the player is likely to go. That means follow the walkable terrain and defer sky and underground for later (when they return to the location or linger for a while). Multi-...


3

From the documentation on the Box2D site: Worms Clones Making a worms clone requires arbitrarily destructible terrain. This is beyond the scope of Box2D, so you will have to figure out how to do this on your own. So you're on your own for building a new terrain when the old one gets a large crater blown into it. I think, following the questions ...


3

I was able to solve this problem by optimizing the shader. This first change will get us down from 68 instructions to 67. We have logic in the shader that only occurs for pixels of terrain that are below the water level, you can see this logic separated by this code: if ( waterTerrainDiff > 0 ) { } Within that was this: waterTerrainDiff = clamp(...


3

Fundamentally, hexagon height fields have the same issue that rectangles do; it's not really possible to ensure that a hexagon/rectangle will be entirely coplanar without putting some heavy restrictions on the possible shapes of the terrain, and on the editing of the terrain. That is, each time you move a single vertex, that change will "ripple out" across ...


3

I would recommend the 2nd option. With it, you are only updating one item (the position of the player). Whereas in the 1st option, you must update the position of every other object in the world.


3

The commandos titles look like they use prerendered backgrounds. This means that one or multiple artists design the whole wort in a 2d or 3d programm. Commandos looks like it was done in 3d and then post processed in like photoshop. The exporter of the 3d programm used a special export method, as the viewing perspective is not physically correct. Objects ...


3

Games usually turn on some sort of effects, primarily blue fog, when the camera is underwater. To handle the situation where the near plane clips through the water surface, you can turn on the fog shader when the camera gets close to the water surface, but then add some code to the pixel shader that calculates the point on the near plane corresponding to ...


3

The reflection itself is just the specular reflection that you get as an output of the functions of your specific illumination model. There are many different illumination models of varying levels of complexity that will produce a reflection shape similar to this, but a similar look to this can already be achieved with a simple bare bones blinn-phong ...


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