Jump to content

Gaia/Unity Texturing and Arrays


Mike P
 Share

Recommended Posts

Is there a plan or fix coming "soon" that addresses the current issues with texture arrays referencing back to unity terrain arrays.

I know that was a vague question so let me explain a little.  It's painful to change a single texture in Gaia Resources fold-out for a texture only to have the texture automatically added to the bottom layer of the terrain when you are clearly changing an existing texture both in Gaia and Unity terrain.  Additionally, let's say you want to add a new texture as position 2 in Gaia. You duplicate the existing position 1 texture and change the respective resource fields. When you do so, the texture always placed last on the terrain? Why?  Furthermore, if you go to the resources tab and remove everything and regenerate for the world, or even locally, the old textures are back in their original positions on the terrain and the new texture you just added is still placed last. Only fix is to manually rename the layers in the texture layers folder and re-sync manually between Gaia and Unity.

Furthermore, please add an option to sync between unity and Gaia and not just update unity from Gaia resource foldouts. As it appears to achieve some out-of-the box things with texturing beyond world-designer and stamping, you always end up going back to the unity textures to adjust things which then don't save back to the Gaia settings of that texture. You truly need a text array tool for the system.

Thanks for listening hopefully there is something in the near future for this

Link to comment
Share on other sites

On 12/31/2021 at 6:35 PM, Mike P said:

It's painful to change a single texture in Gaia Resources fold-out for a texture only to have the texture automatically added to the bottom layer of the terrain when you are clearly changing an existing texture both in Gaia and Unity terrain. 

This should only happen if you edit a texture / terrain layer that is in use in a different spawn rule elsewhere already. If this is not the case, it will just edit / swap out the texture. 
When it does happen, it does happen for a reason because otherwise it would e.g. not be possible to duplicate a spawn rule to use it for a different texture - imagine you have a rule A and duplicate it, so now you have rule A and rule B with both using the exact same resource settings. Now you change the diffuse texture for rule b - at this point we need to create a new terrain layer, otherwise we would edit both resources for A and B at the same time.
 

On 12/31/2021 at 6:35 PM, Mike P said:

When you do so, the texture always placed last on the terrain? Why?

Because if we would add the new terrain layer in the middle it disrupts the index of the texturing on the terrain which can create issues with scripts that depend on the terrain layer index (e.g. footstep sounds that sound different on each layer) terrain shaders that use the index to associate with the correct splatmap data from the terrain data object, etc.
We got issues with this a lot when we were still offering our CTS terrain shader, users would add a terrain layer in the middle of the order and would not understand how this can influence a terrain shader reading the splatmap data from the terrain.

On 12/31/2021 at 6:35 PM, Mike P said:

  Furthermore, if you go to the resources tab and remove everything and regenerate for the world, or even locally, the old textures are back in their original positions on the terrain and the new texture you just added is still placed last.

The order of the terrain layers should be determined by their order in the spawner. Please try the following: Create a new terrain with any biome so that you can see the texturing, scramble the spawn rules in the texture spawner, remove the terrain layers with the resource removal tool and spawn again. This is what I got when scrambling the alpine meadow biome textures:
image.png

 

On 12/31/2021 at 6:35 PM, Mike P said:

Furthermore, please add an option to sync between unity and Gaia and not just update unity from Gaia resource foldouts.

This could potentially be interesting, but that is not as easy as it might seem like. There is no event that tells us when a terrain layer was changed, so we would need to do the sync at certain times only e.g. when selecting the spawner and before spawn.
There are edge cases to consider like what if the user deletes a layer? Should that deletion be synced in the spawner so you lose your settings in there? Clearing the resources from terrain would then immediately delete your spawner settings.
What if an user adds a new layer manually using a certain texture that is used in one of the spawners, should it automatically start syncing that into the spawner even though the layer was not created from there originally? What if you do terrain loading and a new terrain is being loaded in that has a layer setup with conflicting settings, should that override everything in the spawner immediately?

 

Link to comment
Share on other sites

Posted (edited)
On 1/2/2022 at 2:38 PM, Peter said:

This should only happen if you edit a texture / terrain layer that is in use in a different spawn rule elsewhere already. If this is not the case, it will just edit / swap out the texture. 
When it does happen, it does happen for a reason because otherwise it would e.g. not be possible to duplicate a spawn rule to use it for a different texture - imagine you have a rule A and duplicate it, so now you have rule A and rule B with both using the exact same resource settings. Now you change the diffuse texture for rule b - at this point we need to create a new terrain layer, otherwise we would edit both resources for A and B at the same time.
 

I get that. still think there are issues with it though. Thank you for the detailed response.

 

On 1/2/2022 at 2:38 PM, Peter said:

Because if we would add the new terrain layer in the middle it disrupts the index of the texturing on the terrain which can create issues with scripts that depend on the terrain layer index (e.g. footstep sounds that sound different on each layer) terrain shaders that use the index to associate with the correct splatmap data from the terrain data object, etc.
We got issues with this a lot when we were still offering our CTS terrain shader, users would add a terrain layer in the middle of the order and would not understand how this can influence a terrain shader reading the splatmap data from the terrain.

The order of the terrain layers should be determined by their order in the spawner. Please try the following: Create a new terrain with any biome so that you can see the texturing, scramble the spawn rules in the texture spawner, remove the terrain layers with the resource removal tool and spawn again. This is what I got when scrambling the alpine meadow biome textures:
image.png

 

Completely understand and not arguing.  Moving texture in Gaia Spawner is not possible without redoing all the resources one by one which then from what I've experienced causes issues with the sync between unity's texturing and Gaia.  Eventually Gaia will think a new texture has been added when in fact it's just been changed, and will add the same texture again -- this has happened repeatedly. Perhaps I'm missing that you can move them, if so, my apologies.

 

On 1/2/2022 at 2:38 PM, Peter said:

This could potentially be interesting, but that is not as easy as it might seem like. There is no event that tells us when a terrain layer was changed, so we would need to do the sync at certain times only e.g. when selecting the spawner and before spawn.

There are edge cases to consider like what if the user deletes a layer? Should that deletion be synced in the spawner so you lose your settings in there? Clearing the resources from terrain would then immediately delete your spawner settings.
What if an user adds a new layer manually using a certain texture that is used in one of the spawners, should it automatically start syncing that into the spawner even though the layer was not created from there originally? What if you do terrain loading and a new terrain is being loaded in that has a layer setup with conflicting settings, should that override everything in the spawner immediately?
 

Not necessarily.  Gaia should just be the gospel for determining if new textures have to be added or removed, as it does, for the most part now.  Having said that, Gaia needs a texture array / layer tool that allows you to move textures up and down in the layer(have it for the most part now, the spawner) or perhaps the spawner should just allow that and do it's magic on the layers since you already have the logic in there now.

And speaking of layers....  When you option to remove from the resource management button and you select remove terrain layers.  Gaia should remove the actual terrain layer file from the asset terrain layers folder.  I've see it time and time again regenerate the same texture, or nothing at all, when that texture was not even part of the spawner textures anymore after initiating the "remove terrain layer" option.  So to clear this up and force Gaia to re-generate the layers properly, I had to delete the actual terrain layers from the terrain layers folder after removing them from the Gaia Resources.

Syncing:  The simpler it is the better it is:  Gaia's "Syncing" is already there for the most part. Needs fine tuning and some more "love" to do it right.  Example.  If you change normal sizes via unity's terrain texture settings, you should be able to re-sync from Gaia so Gaia can see if what Gaia has is different than what Unity has.  Option for this or auto it when once changes. Same applies for other settings in the unity terrain texture like metallic and smoothness, tile size........... I do not believe this to be a hard "wish list" item to achieve.

Further example of above.  You have 5 textures in the texture spawner.  Not happy with the result of 1 or some of them and you decide for texture sake that moving texture 2 to textures 4s position and texture 1 to textures 3 position and texture 3 to textures 5 position.  You should be able to move up or move down or drag the rule up or down and Gaia will do the magic behind the scenes with the layer. That' s just a re-ordering of the array as well as unity's terrain layer.  Yes it will result the layer being re-generated that that's okay and should be.

After all is said and done, click "sync terrains" and Gaia goes out and re-orders the layers or deletes them and regenerates them, etc... I know I'm making it sound easier than it is.  But I do know it's no that difficult either as I've done it on a smaller scale in other projects.  I know this is more larger scale, but just the same....

You asked what if a user adds a new layer manually--- Then that's a problem they would have to resolve, manually as well.  If you make it so Gaia is starting and ending things it's hard to "need-to" do it manually then.  Use the tools you have and allow them to talk to each other and do the work for you.  That's why we make assets/tools.  For example. If a texture is added to Unity's layer that is not part of Gaias Textures the the question should be asked if that should replace the Gaia texture or not----but only when the user comes back to Gaia and Clicks the "sync" button as it's a two-way street. Get where I'm going with this.  Sorry.. want to explain more but I cut the shit out of my fingers the other day and having some difficulty typing today.....  I guess a good use-example would for you guys to take a look at MicroSplats Texture Array and Shader tool. I think it's truly one of the best texture array tools out there, just built into MS Asset.

 

 

Edited by Mike P
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
 Share

  • Tell a friend

    Love Unity 3D World & Game Creation Tools - Canopy - Procedural Worlds? Tell a friend!
  • Interesting Articles

    1. 0

      Different layers are being combined together.

    2. 42

      GeNa Pro City Generator

    3. 1

      World Creator + Gaia

    4. 1

      Gena decorator??

    5. 1

      Objects spawning at unexpected position in segmented scene.

×
×
  • Create New...