• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Misery

Why terrain mesh consists of elements of unequal size and has vertical walls?

8 posts in this topic

Hello

I have created my first terrain in Unity using Heightmap.I used a heightmap created in Photoshop.

 

Actually the terrain looks fine. It has only two glitches:

1. On the bounds of the terrain it has vertical walls which - according to the heightmap shouldn't be there. Why such thing occured there?

2. The terrain looks like it has mesh which density becomes larger as it gets closer to the bounds. Is it normal? I am afraid that it can slow down framerate.

Below are the images.

 

Terrain props:

[attachment=23118:terrain props.PNG]

 

Heightmap:

[attachment=23115:HeightMap.png]

 

Vertical walls:

[attachment=23117:VerticalWall.PNG]

 

Terrain mesh:

[attachment=23116:StrangeHeightmapMesh.PNG]

 

 

0

Share this post


Link to post
Share on other sites

The field heightmap resolution reads 1025 although your texture is 1024 pixels wide. Maybe that is the problem with the wall.

0

Share this post


Link to post
Share on other sites

The field heightmap resolution reads 1025 although your texture is 1024 pixels wide. Maybe that is the problem with the wall.

I tried with the image 1025x1025 and the result was the same.

0

Share this post


Link to post
Share on other sites

After I rescaled my map so some of the heightmap is white vertical walls disappeared. But still I do not understand why the mesh is more dense at the bounds.

0

Share this post


Link to post
Share on other sites

Altough I have not dabbled to much with the terrain settings (hey, don't fix it if it ain't broken), I'll try to stab in the dark here a little bit:

 

Could this have to do with the Terrain LOD System? Does the shown density stays the same when you move around the camera? Even in Edit mode, terrain LOD System will kick in to keep up a constant FPS Rate.

 

The fact that this higher density areas are only visible in the foreground, is somehow pointing in this direction.

 

If you play around with the pixel error settings, does that change anything for you? AFIAK, the lower the pixel error, the higher the Terrain Resolution. 5 is the default value, so I guess you haven't played around with it yet?

 

Are there active cameras around the bounds that could cause the Terrain LOD System to increase the LOD Level for that areas? (makes little sense to me if the picture was taken in the Scene view, but hell, stranger things have happened).

1

Share this post


Link to post
Share on other sites

About adding pure white fixing the walls: Height maps should always range from pure white at the highest point to pure black at their lowest. You scale the height map to the actual min and max height later, but that image should use to full range of greys. To properly fix it, check the histogram of the image in Photoshop and adjust the image levels (or hit auto-levels) so that the entire range is used. Be careful not to clip the whites and blacks as you will create flat spots on the terrain.

1

Share this post


Link to post
Share on other sites

For your wall, as others have pointed out, you specified different resolutions which can cause effects like that. Sounds like you got that figured out.

 

 

For the third image in your post, Gian-Reto is correct that it comes from the dynamic LOD system.  To reduce processing it automatically downsamples the mesh for the less critical areas. Exactly how critical an area is depends on several factors, including its depth,  but also how prominently it is displayed on the screen (such as mountain peaks in the distance) and the mathematically-accumulated visual error. Whenever they switch between depths there adjacent region needs to be broken up carefully to avoid t-junctions.

 

Picture found online of a t-junction in terrain:

 

T-Junction.jpg

 

It has to break up the mesh a certain way to prevent tiny holes, or to prevent some slight flickering, which can occur at boundaries.

 

 

Finally, for your other settings, you have a fairly dense texture map. Usually you want somewhere around 2-4 meters per pixel, then use models to represent critical things on the terrain. You've got about 0.67 meters per pixel, which means you'll be spending more processing time on rendering. It is not a wrong value, but it can mean additional LOD processing, additional draw calls, and additional rendering effort on the terrain.  Given the tradeoff most games prefer to spend the effort on game models rather than the ground.

 

As you are just learning those settings are fine, but as you gain experience and your scenes become more complicated you will eventually need to make decisions about where to spend your computing power. Decreasing the terrain density is an easy tradeoff, since dense terrains and especially dense control textures can consume quite a lot of resources.  

 

For now, even though the many options are confusing when you start out just know that there are good reasons for the choices and they become important details in bigger projects.

2

Share this post


Link to post
Share on other sites

Finally, for your other settings, you have a fairly dense texture map. Usually you want somewhere around 2-4 meters per pixel, then use models to represent critical things on the terrain. You've got about 0.67 meters per pixel, which means you'll be spending more processing time on rendering. It is not a wrong value, but it can mean additional LOD processing, additional draw calls, and additional

 

About that: AFAIK, one easy fix can be to set the pixel error setting to a higher number. Your Terrain will now look less detailed (most probably because the Terrain LOD Systems uses lesser LOD Levels), but the amount of processing power spent on the terrain can decrease dramatically.

 

Tested that myself and the difference is staggering between pixel error of 1, 5, or 9. Both in Visual impact, and processing power saved.

 

 

Not saying this is better than adjusting the heightmap the Terrain is generated from, its just a good temporary option to reduce the amount of horsepower wasted on your terrain if your FPS are low.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0