Jump to content

Applying biome image masks to textures

Bil Simser
Go to solution Solved by Peter,

Recommended Posts

Hi guys,

I have a question (and probably misunderstanding) about a biome mask.

I've got an image split up with multiple colours for the biomes (attached). I created 5 biomes to match my image mask and added the image mask to each biome. I then used the PRO Color Selection filter to select the colour of each section of the mask. In the attached image purple for example represents a dead forest so I want to use a dead forest base texture while white represents a snow biome so I want the base texture to be snow.

So far so good. When I visualize each biome it looks fine on the terrain. When I add a different texture spawner to each biome it just applies it to teh entire terrain. I've also copied the image mask from the biome and applied it to the texture spawner but it doesn't seem to be respecting it and applies the texture to the entire terrain.

I must be missing something or doing something wrong?



Link to comment
Share on other sites

Hi Bil,

just from reading the post your approach sounds valid, this is exactly how the masks / biomes are supposed to be used when you want to have different biomes in different areas in your world. All masks in the biome controller should be passed down into the texture spawners and they should be limited to that area then. I will grab your mask image and play this through from my side to see if there is any pitfalls with this that I currently can't think of.
One potential issue I could imagine:
When you start testing with the very first biome, I would expect that texture to go everywhere on the terrain regardless of the mask - since this is the very first terrain layer that is being added to the terrain, that becomes the default texture on the terrain and is then displayed everywhere. This is no bug or issue, but standard behavior of unity, as soon as the first terrain layer is being added that becomes the default "look" of the terrain, and you need a second layer that you then paint on top of that first "default" layer. Could it be that you started testing, and this behavior made it look like the masks are not working?

Link to comment
Share on other sites

It's possible as I selected the first one and yes, it aplied it everywhere. I'm trying to make it so I don't have a default texture applied but rather biome specific textures. Not sure how to get around this.

The other thing that came up is the size. My terrain is 4096 right now and on the biomes I've selected Fit to World (so they expand to 4096) but then when I apply the biome say for the middle mask (the purple one) I get that texture applied to 16 sections of the terrain individually rather than the whole thing. I did change the biome setting from local to world and set the texture spawner (the only spawner in the biomes) to fit to world so they expand to 4096. When I run the spawn biome a) it applies it to 16 sections of the whole terrain not the terrain itself (there's only one terrain) and b) the spawner setting changes the range back to 1024 after spawning (but the biome setting stays at 4096).

Link to comment
Share on other sites

A couple of notes:

1. I can create a new biome that covers the entire terrain with no mask and a single base texture (e.g. sand, dirt) and run that first. That might fix the problem of applying the texture to the terrain regardless of masks.

2. I'm using Gaia 2021 3.13 and Unity 2021

Link to comment
Share on other sites

  • Solution
2 minutes ago, Bil Simser said:

I'm trying to make it so I don't have a default texture applied but rather biome specific textures. Not sure how to get around this.

This should rather be a formality, but as soon as you continue spawning your other biomes one after another, you should get the results that you want - the default texture would only apply to the first spawned biome, but the following ones would paint on top of that, and the end result should be as you want it (if I understood you correctly, that is).
I took the mask for a spin and added the first 3 texture biomes with one texture spawner each (see in my hierarchy). The green texture is the first one I spawned, which went across the entire terrain, and then the two other textures went on top. If I would continue like that, I would get one texture each for each area of your input mask image:




 When I run the spawn biome a) it applies it to 16 sections of the whole terrain not the terrain itself (there's only one terrain)

Could you please try to switch the "Mask Space" on the mask to "World" and make sure the visualization looks good before you try to spawn again?


This should fix this behavior. The issue is that the spawners start iterating over larger terrains instead of processing them all at once. If the mask is set to local space, that mask will "follow" the spawner around as it iterates over the terrain, instead of being applied to the world as a whole. You can find a more detailed explanation here:
(See under "7. Local vs. World Mask Space")
The reduction of the spawner range is a side effect of that as well as this is the size that the spawner uses to iterate over the terrain while processing.


Link to comment
Share on other sites

Okay I didn't realize the mask space itself has a setting for local vs. world. That created different results though.

Here's the green biome mask set to local space. Note that it does appear correctly with the visualizer turned on but then will spawn the textures in 16 segments.


So then I changed the biome mask space to world and got this result:


Which is odd. The terrain is 4096, the mask (and texture) are both set to 4096 and world space.

So I spawned the biome and got what I expected (but wrong). The green biome spawned in the lower section (this was spawned with the biome mask set to world) and changing the visualization back to local in the biome mask and turning it on shows where it should have placed it.


So I'm very confused. Will try clearing out the textures and settings and respawn things. I think what you describe works just not sure why my setup isn't behaving correctly.


Link to comment
Share on other sites

I think I have it working. I noticed the biome x/z was set to 3072 (soemthing to do with the mask and it's position I guess?) so I set the x/z offset/position in the mask to the same value and it put it in the right place. Will have to read up on local vs. world space and I guess there's an extra thing with a situation like this where the mask is offsetting the biome and causing it shift.

Not sure why 3072 is a magic number but has to do something with my biome mask. In any case, it worked so now I'll move onto adding trees and such to each biome now.


One more question is there a single "spawn all biomes" way in Gaia? Right now I have to click each biome one by one (and in the correct order).

EDIT: The terrain is 4096x4096 and Gaia positioned it at -1024 and -1024 (x and z respectively) so that's where 3072 comes from.

Edited by Bil Simser
Added image
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...