Questions tagged [terrain]

Terrain, or land relief, is the vertical and horizontal dimension of land surface. Terrain is used as a general term in physical geography, referring to the lie of the land. This is usually expressed in terms of the elevation, slope, and orientation of terrain features. In games, terrain is the "land" or "world" on which the game environment, roads, buildings, vehicles, characters are placed and interact with each other.

Terrain, or land relief, is the vertical and horizontal dimension of land surface. Terrain is used as a general term in physical geography, referring to the lie of the land. This is usually expressed in terms of the elevation, slope, and orientation of terrain features. In games, terrain is the "land" or "world" on which the game environment, roads, buildings, vehicles, characters are placed and interact with each other.

This tag is for question related to terrain, its properties, problems related to setting different properties, lighting, textures, simulating gravity, friction etc for use in games or simulations.

574 questions
0
votes
1 answer

How do you find the Y position of a point between four vertices? HLSL

Let's say there is a grid terrain for a game composed of tiles made of two triangles - made from four vertices. How would we find the Y (up) position of a point between the four vertices? I have tried this: float diffZ1 = lerp(heights[0],…
Obi-Dan
  • 113
  • 1
  • 8
0
votes
0 answers

DirectX11 Terrain Smoothing Technique

I have a terrain system set up which utilizes a quad tree and a gray scale height map to draw the terrain. I create one 64x64 flat triangulated grid, which is then drawn at various scales based on the quad tree node selection. In the vertex shader,…
Ben Trapani
  • 271
  • 1
  • 4
  • 11
0
votes
2 answers

Terrain streaming in unity 3d

I am making an open world game and i want to know if there is a way of doing terrain streaming ( loading the terrain into mamory only if the player is close to it ) without using the LoadLevelAdditiveAsync function . i am using free version so this…
user3789296
  • 23
  • 3
  • 6
0
votes
0 answers

Texture a heightmap with a DisplayList & GL_TRIANGLE_STRIP?

glNewList(heightmapDisplayList, GL_COMPILE); // Iterate over the 'strips' of heightmap data. for (int z = 0; z < data.length - 1; z++) { // Render a triangle strip for each 'strip'. glBegin(GL_TRIANGLE_STRIP); for…
Joehot200
  • 1,070
  • 15
  • 44
0
votes
1 answer

Efficiently rendering a transparent terrain in OpenGL

I'm writing an OpenGL program that visualizes caves, so when I visualize the surface terrain I'd like to make it transparent, so you can see the caves below. I'm assuming I can normalize the data from a Digital Elevation Model into a grid aligned…
Andy
  • 7,885
  • 5
  • 55
  • 61
0
votes
2 answers

What is wrong with my normal calculations?

I attempted to use the algorithm described at OpenGL - How to calculate normals in a terrain height grid?. I popped it in my vertex shader and using some perlin noise functions to test it, and it worked like a charm, however when I ported it to…
seesharper
  • 147
  • 4
  • 16
0
votes
0 answers

How to procedurally generate terrain to make an infinite terrain?

I have been researching this subject just about everywhere I can find it, but all everyone talks about is the mathematical side to things, not about how to make an infinite randomly generated terrain. I am pretty new to Unity, so when say things…
user3623628
0
votes
1 answer

WebGL terrain grid shrinking after 128 pixels

I'm working on a heightmap algorithm using webgl. I thought I had it working but I realised a critical problem with my grid generation. If I set my grid size > 128 iterations, something strange happens: the grid stops growing on the z axis and I end…
alx
  • 71
  • 8
0
votes
1 answer

Weird normal generation on height map based terrain

I'm working on terrain generation using libnoise and OpenGL. I have made a somewhat complex normal generation algorithm as it seems: list = glGenLists(1); glNewList(list,…
Sup3rlum
  • 51
  • 7
0
votes
2 answers

turn small double to int

I'm using libnoise to generate 2D sprite forrests. Then I made my world larger, I am currently working within world 1.0 to -1.0. The problem now is that I can no longer generate the few pixels the trees are offset by (from their grid positions). So…
0
votes
2 answers

Terrain only rendered underside

I'm trying to render a map, but unfortunately, only the underside is rendered. I guess I'm doing something wrong while setting up the vertex and index buffers. This is the part I initialize the vertex and index buffers: // Initialize vertices and…
0
votes
1 answer

How to save Graphics as a bitmap image

I was just wondering how to do something, how to save something that is drawn onto a form with Graphics to a bitmap file, everything I have tried so far hasn't worked, just a bit of a background of what I am doing, I am trying to create a random…
user3349095
  • 59
  • 2
  • 10
0
votes
1 answer

Texturing a triangulated terrain without redrawing vertices

I am making a program do display a 3D textured terrain. I`m having some performance issues. I am drawing the terrain and texturing it at the same time -> void Triangle::drawTriangle( int showTexture){ if (textureId!=0 && showTexture)…
0
votes
0 answers

Unity Shader overriding Mesh UVs. How can I fix it?

I have a terrain made out of four meshes. To these meshes I have added one single texture and created the individual UV maps for each of the meshes. All pretty and done, but when I try to apply a shader : Shader.Find( "Transparent/Bumped Diffuse"…
whoadrian
  • 77
  • 1
  • 7
0
votes
2 answers

OPENGL Terrain from text file

I am trying to create terrain which takes height values from txt file . During my search I realized that generally the terrains are created from bmp files or another kind of picture taking values from pixels. I read height values from file into a 2d…