[HELP] Render Terrain - not expert - Academic & Research purposes (755123)

Hello dear comunity,

Im a geologist and im not an expert on the Unity Software either with programing languages.

Anyway i have been using Unity for Academic & Research purposes, in my graduation and now in my master degree (Check out my work here)

Lets gets started with my doubt, shall we?!

I have finished my most recent didatic 3D model on sea level oscilations, but i have a problem that can be found on the last one too, the visualization of the surface is ruined by some square forms on the terrain there is some kind of solution on this issue?

here are some of my terrain settings if its serves as any help…

Are you able to show an image without the water so that we can see what’s going on around your coastlines in more detail?

Depending on the cause there may be no solution which will completely remove the square shapes, because the terrain surface is made of squares under the hood. That’s a simplification, but it’ll do for now.

That said, your “Heightmap resolution” is very low compared to the size of your terrain. You’ve got a 1025 grid to determine your terrain’s height samples, but a 5000 unit square terrain. That means that each pixel on your heightmap maps to about 5 units on the rendered terrain. Re-authoring that at a higher resolution may help to smooth out those artifacts, even if you’re just opening it in an image package, scaling it up, and applying a blur to smooth the existing pixels.

It’s also possible that this is coming from the format of the data within the texture. There is some relevant discussion of this here which may help you.

2 Likes

Here is it with water
4878182--470660--upload_2019-8-20_19-32-5.png

and here is it without water

4878182--470663--upload_2019-8-20_19-32-36.png

Im gonna try to edit my .raw, thanks for this idea!
Some people had saied that i must split my terrain on smaller ones, do you think it is a solution also?

This happaned at 4097 resolution

Back to 1025 resolution…
The borders are really that way, and some other get even more squares at distance view.
And i cant shape it rounded and neither smooth

That problem isn’t the resolution, it’s the data. It almost looks like there was a sharpen applied or something… (higher contrast at the edges, rather than smoothing).

Do you think i could save this terrain somehow? the terrain is based on a real world terrain with some shapes modified by me to show a geologic evolution among the time, so its a important data.

You mean recover it for use? Sure.

How did you upscale it? That’s probably where the spikes came from.

Also, for future reference, this “General Discussion” areaisn’t for support questions. You’d probably get better responses from the appropriate section, as it’d be more likely to get seen by someone cluey about terrain specifics.

i dont know how to answer your last question
but i had upload a video to show you how it is now;
This is 90% of my results on my master degree on geology but its getting anoying the fact of this squares ruining the scenario i wanna show.

https://www.youtube.com/watch?v=muX-x3sr_7Q

im sorry about that, im kind of lost on this forum yet

It was originally 1025, then you showed a 4097. What did you do to get it from 1025 to 4097?

I had a similar issue with UK OS data before. Here’s a quick solution that may work, depending on your source data:

  • Open the 1025 .raw in Photoshop
  • Resize it to 4k
  • Set the bit depth to 16 bit (Image>Mode>16bit/pixel)
  • Apply a Blur of some sort (Filter>Blur/Gaussian Blur/Box Blur).

The source of your problem is (as others have mentioned) a combination of low-resolution height data with (I suspect) low bit depth. The above steps should help to smooth things out and gain more resolution. Note that this will slightly alter your height data, but depending on the blur you use it shouldn’t be more than a few centimeters (which is less than the error on most height scan data). Either way (just because you mentioned you’re not a developer), be sure to make backups as you go so that the original data doesn’t get lost.

2 Likes

What is the resolution of your original source data and what is the resolution of your manually modified data? Where did you make the modifications? In Unity or in a program like World Machine?

Is there a reason you need to use a terrain renderer instead of a mesh renderer with a terrain shader that works for meshes?

Question to the Unity community: is there a simple way to use only the tree rendering part of the terrain system in combination with a mesh?

I’m asking this because in my experiments with big terrains (using between 2k and 4k input textures iirc) I’ve had good performance increases for using just a big mesh at max resolution compared to the terrain renderer component. And that would eliminate all pop in as the camera moves.

I believe the look of the mesh at the coastal line could be improved too by rotating some of the diagonal edges on the quads to align better with the curvature of the shoreline. I’m speculating here, but maybe that could be done automatically with either meshlab or blender.

Shouldn’t the raw be 16 bit in the first place? If not it should be converted to that before resizing imho.

It’ll depend where it was exported from, some programs only export in 8-bit. And yeah, good call with setting the depth before resizing. With the blur afterwards it won’t make too much of a difference, but it’ll help make things smoother.

1 Like

In Photoshop, by Image>Sizy of the image>> i exchanged the values of the pixels and due to this i obtained
4881071--471107--upload_2019-8-21_12-48-5.png

the problem on that is appearance of this forms on the data, corrupting its values. The simple fact of opening the Terrain on Photoshop will ruin it and appear this kind of problem even if it is on its former resolution (1025)

4881071--471110--upload_2019-8-21_12-49-4.png

This form turn my terrain
4881071--471113--upload_2019-8-21_12-51-33.jpg

but if i dont open the original .raw on Photoshop it wont corrupt and i can still import on unity, i will attach this files in case u are curious about it

Martin_H and MR-Archer, thank you for your answers, i will take a look on your sugestions as soon as possible. i have a meet right now on the university i will get back to try it and reply. Thanks!!

Terrains on .rar
2 files: the 1025 reso and the 4097 reso

4881080–471116–Terreno Import.rar (3.41 MB)

You need the right tools. All global satellite height maps are low resolution,…period. and the size of your map compounds the problems…simply put your height maps needs to be re built, used as a “shaping guide”…I use World Machine, I’ll take a look. and upscale it for you…can you give me the sat coordinates& total square KMs… would be best.

From a Satellite Data…



Patrick

2 Likes

There are different issues here. First, I think you’ve selected the wrong byte-order in photoshop when opening it. One option gives me the result from your screenshot, the other one opens an almost black image, but if you brighten it up with a levels adjustment layer it looks like this:

4881278--471140--upload_2019-8-21_18-37-0.jpg

Then, if you zoom in into places like this, you’ll see that the square artifacts are already much bigger than the pixel resolution:

4881278--471152--upload_2019-8-21_18-37-45.png

In other words you’re working with bad data from the get go and if you apply filtering to the whole heightmap that is so extreme that it smoothes these artifacts out, you’ll lose all the detail you would want to keep too.

I think the first step would be to look for a better heightmap source. There are a lot of places in this heightmap that look sloppily hand edited. The artifacts that look like the map was sharpened are also already present:
4881278--471155--upload_2019-8-21_18-42-0.png

The file is 16 bit, which is better than 8 bit, but with the way the height range data is mapped to those 16 bits - using only a tiny fraction at the bottom of the scale/histogram - you’re effectively not having enough bits of precision for the range in which the subtly sloped part of the terrain is. I’ve tonemapped it to roughly fill the 0…1 brightness range and you can see terrible banding artifacts in the flat area here:

4881278--471158--upload_2019-8-21_18-45-43.png

I really think your first step should be trying to get better quality heightmap data to work from. I have my doubts that this can be “saved” in any sensible way.

Good choice posting the original data for us, we could have wasted tons of time speculating on what you might have done wrong in Unity or the upscaling process, when it seems to be the source data that is responsible for most issues.

1 Like

Are you trying to represent the effects of thermal erosion (water/wind) on current land mass in an accelerated time scale?.

1 Like

I will try to explain what im doing on this whole work. Im a geologist trying to show the evolution of this land (Armação dos Búzios - RJ ( Brazil) ) among the last 5.000 years, when the sea level was higher than it is today.

In order to show it, i manipulated the real world terrain in the areas that were flooded on that time. making it like a ladder with steps while i just adjust the (Y value) of the Water revealing new terrains among the time

on this picture you can see the original data and my handmade manipulation in unity of the terrain (in blue)

So, the option on getting a new or better data to import would lose all the modifications that i had worked on, and thats is sad. I’m really not an expert just tried to use the software for other means, thats probably why i “fucked up” and just realized it now.

the source of this data had came from the website https://terrain.party/

On this video at that clip moment (2:32) you can see the result of my research and why i manipulated the terrain in unity