Jump to content

Gaia terrain data corrupted


Matmalm

Recommended Posts

Using Gaia 3.3.0 and Unity 2021.3.6

 

Whenever I'm painting between 2 terrains, it's creating an extra layer for the other terrain. However, all of the layers are in the same order and all of the terrains share the same layer.

When I go to 'Resource helper' and copy all of the layers to all of the terrains, the problem is fixed. But when I press 'save project' the issue starts again.

Link to comment
Share on other sites

This is a funny issue. 

My advice to fix the problem is to use the resource helper and remove all the textures. 
Then use the biome and spawn the entire world. 
This will set the correct layers on all terrains. 
Then start painting, just remember if you make any changes to the texture while painting on one you will need to do that for both or use the biome or the terrain will think that its a new texture. 

 

Link to comment
Share on other sites

48 minutes ago, Bryan said:

This is a funny issue. 

My advice to fix the problem is to use the resource helper and remove all the textures. 
Then use the biome and spawn the entire world. 
This will set the correct layers on all terrains. 
Then start painting, just remember if you make any changes to the texture while painting on one you will need to do that for both or use the biome or the terrain will think that its a new texture. 

 

I can't erase them as I already have most of the terrains painted. However now I'm making some changes which the Gaia texture spawner could help.

Link to comment
Share on other sites

7 hours ago, Bryan said:

Ok, so the best option is remove the extra layers after your finished painting. 
 

If I remove them, then the painted terrain will become the first layer in the array

Link to comment
Share on other sites

54 minutes ago, Bryan said:

I would test just to make sure. 
As long as your within the texture limit you should be fine. 
 

I meant; it did change to the first texture in the array. I already tried it.

Link to comment
Share on other sites

Hi @Matmalm,

please note that the manual drawing with the terrain inspector is first and foremost an unity feature. If two terrains in unity share the same terrain layer file between them, there should normally not be a new layer file being created when you draw across the terrain borders.
What can happen is that two terrains seem to have the same layer on them because it looks the same and has the same name, but they actually point to two different layer files in the project hierarchy. You can double check this by selecting the layer on both terrains and clicking the "open" button, this will select the layer file in the project hierarchy.
image.png
If both terrains point to the same layer file in the project hierarchy, it should not create a new layer when painting over the borders.

I did a quick test with a 2x2 terrain setup made by Gaia, and it did not create additional layers between the terrains when painting across the borders. (see my scribbles on the terrain in the screenshot above) . It might be worth to check that on your side as well to see if it immediately happens in a new scene as well, or if it only applies in your current main working scene.

Gaia tries to keep the layers in sync when it adds new layers to a terrain: When a texture layer is added the first time from a Gaia spawn rule, it remembers the layer file it created in this moment from that spawn rule. If there is another terrain in the scene that later also receives a texture from the same spawn rule, it should take the same layer file it stored earlier.

However this can only be kept up within reason, since users and other applications can freely edit the layer setup as well there can be situations where Gaia would create a duplicate, separate layer file.
For example, a new layer file is created by Gaia, the project is under source control and the .meta file gets discarded in the source control system. Unity will generate a new .meta file for the layer, which might have different ID in it, which would then make Gaia lose the connection to that specific layer.

What might be worth a try if you are only using a single biome and can also backup your project easily, is to delete all terrain layer files inside the Gaia Session folder (see screenshot above), then respawn the textures again. This should ensure that the layer files used are the same across all terrains, and would also made sure that the spawner points to the same layer files as well for its spawn rules (since it just created it with the new spawn).

I hope this helps with analyzing this further. If you find that the two terrains are indeed pointing to two different files, it is "normal" that the terrain inspector creates an additional copy of the layer when painting over the border. It is strange though that this still happens even after syncing the layers with the resource tool - even if there was a mix up with the layer files before, after the sync they should be 100% the same. 

If the layer files are 100% the same file between the two terrains, but there is still a new layer being created when painting over the terrain borders, this would rather be a bug in the terrain inspector, and you would need to contact unity support for this. We do unfortunately have no direct influence about how the terrain inspector decides to add a new layer to a neighboring terrain.

Link to comment
Share on other sites

20 hours ago, Peter said:

Gaia tries to keep the layers in sync when it adds new layers to a terrain: When a texture layer is added the first time from a Gaia spawn rule, it remembers the layer file it created in this moment from that spawn rule. If there is another terrain in the scene that later also receives a texture from the same spawn rule, it should take the same layer file it stored earlier.

However this can only be kept up within reason, since users and other applications can freely edit the layer setup as well there can be situations where Gaia would create a duplicate, separate layer file.
For example, a new layer file is created by Gaia, the project is under source control and the .meta file gets discarded in the source control system. Unity will generate a new .meta file for the layer, which might have different ID in it, which would then make Gaia lose the connection to that specific layer.

I'm using microsplat, but this didn't happen before, but the weird thing is that when I press copy layers in the 'resource helper' to all of the terrain the layers go back to normal, however when I press save project, the error comes back again. Then, the only thing left would be plastic scm, but I'm the only member of the workspace, so I don't pull anything, I only did it once when I went back to a commit.

Link to comment
Share on other sites

I do not know microsplat too well unfortunately, but I could imagine that it also has a mechanism built in to add terrain layers to a terrain to fit the textures that it is rendering, so it might come out of that. When you say "the error comes back again", does this mean you notice at some point you got a duplicate layer again, or can you see how after saving two terrains suddenly start using different layer files? If the latter, where are those different layer files located in the project? 

Link to comment
Share on other sites

11 hours ago, Peter said:

I do not know microsplat too well unfortunately, but I could imagine that it also has a mechanism built in to add terrain layers to a terrain to fit the textures that it is rendering, so it might come out of that. When you say "the error comes back again", does this mean you notice at some point you got a duplicate layer again, or can you see how after saving two terrains suddenly start using different layer files? If the latter, where are those different layer files located in the project? 

When I hit 'copy all layers to terrains' the problem goes away and I can paint over the borders of multiple terrains, or I can select a texture layer from terrain x and paint in terrain y. But when I hit 'save project', or I load another scene and try to do the same mentioned before, it will start creating an extra layer.

Link to comment
Share on other sites

I had another look at this reviewing open issues, and if both terrains are referencing the same layer object in the project while painting over the terrain borders this is most likely an unity issue and I'm afraid there is nothing we can do about it as we do have no control over what the terrain inspector does at that moment.

Link to comment
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
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...