Jump to content

World texture spawning doesn't work - gaia confused about where terrain tiles are


sdargiewicz
Go to solution Solved by sdargiewicz,

Recommended Posts

Hi, I cannot get my texture spawners to do what I want.

 

Right now i'm simply creating a biome/spawner with no masks and a spawn rule to put a texture over the whole world. It is not the first terrain layer texture. I have copied all terrain layers to all tiles. I have 1024 tiles total. It works if I manually load a terrain and manually places the spawner over it, and then hit "spawn local". I've tried creating many other spawners to test but they all have the same issue.

 

Gaia seems to get confused about where my world starts and ends. For each terrain tile, it loads my terrain at one position, then places the spawner at a *different* position, then runs the spawn rule. The effect is that nothing happens for every tile. It loads my terrain tiles from (0,0) to (16384,16384) but places the spawner in the range of (-8192,-8192) to (8192, 8192). I don't know why it does this or how to fix it. Any help would be appreciated, thanks.

 

I am using unity 2021.3.8f1 and gaia 2021 from the asset store, version 3.3.4

Link to comment
Share on other sites

After extensive debugging, I found in TerrainScene.cs, line 931 that the variable m_currentOriginOffset is set to a vector3Double of (-7168, 0, -7168) and I believe that is incorrect because that's what's causing the massive shifting of each terrain piece.

 

In TerrainLoaderManger.cs line 952

terrainScene.m_currentOriginOffset = m_sceneViewOriginLoadingBounds.center;

 

this is where it's getting that vector. I don't know why it is that value though. I have no option to set the origin loading bounds center on the terrain loader manager component. I will continue to investigate.

Link to comment
Share on other sites

  • Solution

I added this editor code, ran it, and then ran my texture spawner. Everything works now!

 

if (GUILayout.Button("Reset gaia terrain loader manager origin"))
{
    TerrainLoaderManager.Instance.SetOrigin(Vector3Double.zero);
}

 

So I would suggest some type of change to Gaia where either the spawners also try to follow the m_currentOriginOffset or you reset the terrain loader origin when exiting play mode or in editor somehow. I bet this got corrupted while in play mode and using floating point fix stuff.

Link to comment
Share on other sites

Hello @sdargiewicz,

 

you are pretty spot on with your analysis - Gaia allows you to perform an "Origin Shift" in the scene panel on top of the scene view - this allows you to shift the entire world around during editing in case you experience floating point precision issues:
image.png

E.g. let's say you edit your world at x=-5000 and see issues with shadows flickering, etc. you could enter a shift of +5000 to bring the point you are editing closer to 0,0,0 to get rid off those floating point issues. However the spawner should be aware of that and when you spawn locally it should still be "What you see is what you get" and the spawner should spawn in the location it was placed at, including the shift into its calculations.
We will review this and fix this asap, for now you can avoid this by resetting the OriginShift to 0,0,0 via the scene view panel or your custom button.

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