Jump to content

Terrain Spawner Rules Image Mask


Valority
Go to solution Solved by Peter,

Recommended Posts

Hi,

 

I’m trying to generate a world based on a height map. But the terrain is mostly flat, which results in sand filling most of terrain and grass is only appearing on mountains. How do I adjust it so the sand only appears on the edges of the terrain?

image.thumb.png.30f123ab4eda260b8497d9118dd09757.png

 

I have the following maps which shows where to place sand/grass/cliffs on the terrain, but when I use them in as image masks on the spawner rules, nothing happens. Do I need to use it somewhere else?

image.thumb.jpeg.ecf8436668e14a3dc35236523a538cb3.jpeg

image.thumb.jpeg.3f54f661b6ad9f7080ae55937cabed5c.jpeg

image.thumb.jpeg.1865e1db2a6ef5d52bd08fc632671e96.jpeg

Link to comment
Share on other sites

  • Solution

@Valority I think the issue might be that the sand is the first texture on the terrain - in unity, the first texture on the terrain will automatically be applied everywhere as a default texture. What then happens next is that grass and all the other textures are being spawned on top of that, resulting in the first image you posted.
Applying masks on the sand texture will have no effect, you would rather need to adjust the grass texture so that it spawns in earlier at a lower height. Activate the visualization on the grass spawn rule in the spawner, then try to adjust the height masks so the grass will spawn at lower height:

image.png

Note that if you are using the alpine meadow biome, there are two height masks on the grass texture - this has to do with the noise pattern along the border. You can adjust both height masks to control how much "noise" you have until it is full grass.

image.png

Link to comment
Share on other sites

@Peter Thank you. That fixed the problem to an extend. Because the terrain edges and center is exactly the same height, which makes sand appear at the edges and in the center.

If I moved grass to first layer and sand to the second layer, would I be able to make the sand appear only where this mask is white? Because I can't seem to figure out how to do so.

image.jpeg.c0870d73af46074194764cc4372de9a0.jpeg

 

EDIT: I think I've found a solution. Setting the image mask's filter mode to "Red Color Channel" seems to make it work as intended.

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