Jump to content

Applying biome image masks to textures


Bil Simser
 Share

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?

Thanks

biomes.png

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:

image.png


 

Quote

 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?

image.png

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:
https://canopy.procedural-worlds.com/library/tools/gaia-pro-2021/masking/introduction-to-masks-r50/
(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.

1764424423_biomemasklocalspace.thumb.jpg.98dd9509f70d5a9c800320bbda7bf6f6.jpg

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

607050371_biomemaskworldspace.thumb.jpg.7530705b75b5be86d104e614714254a3.jpg

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.

1643067722_afterspawinglocalvisuzationon.thumb.jpg.2f6662f4f0192340360e8c30504d7baf.jpg

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.

1608618080_properbiomes.thumb.jpg.bd6279b12e26ce3fe95b80bf020c0e50.jpg

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
 Share

  • Tell a friend

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

    1. 2

      I'm getting tired of doing islands and craters

    2. 2

      I'm getting tired of doing islands and craters

    3. 1

      Problems with latest Gaia Update

    4. 1

      Adding shoreline or waterline effects, beaches, river banks, etc.

    5. 1

      Just upgraded my Canopy to Pro

×
×
  • Create New...