Jump to content

Texture Spawner Not Working


Kelsey

Recommended Posts

Hi, I started with making a grid of 32 x 32  1k x 1k terrains and I used the default Coniferous Forest biome to spawn but disabled everything except the texture spawner.  After I used the manual stamper and created a big island in one of the corners I set up my terrain textures, 32 of them in a specific order on my terrains and that part seems to be fine, I've checked some terrains and the textures seem to be in the correct order.  The problem is that when I run "Spawn World" on my texture spawner, that I've added all 32 textures to, and disabled all but the Ocean Floor texture which should spawn only at a height of 0 - 490, a beach texture that should spawn at a height of 490 to 505 and on a 0 - 45 degree slope, a grass texture which should spawn at a height of 505 to MAX height and a slope of 0 - 45 degrees, and a mountain texture that should only spawn on slopes of 45-90 degrees.  The problem is that the only texture that's spawning is the ocean floor texture and all of those textures are enabled.

What can I do to get these textures spawning correctly?

Link to comment
Share on other sites

There are no errors in the console.  I've tried moving the spawner around and having it on max range and spawning it in different locations but its still not working.

Link to comment
Share on other sites

That's how many textures are on my terrain's layers but I'm only trying to spawn 4 of them on the terrain with rules for now for testing.

Link to comment
Share on other sites

I do have 32 texture spawning rules ( one for each terrain texture ) but only 4 of them are active.

When I try to spawn world it only says something along the lines of "Spawning Rule 0 of 4..." and then does that through all of the terrains and I never see it say 1, 2, 3, or 4 on the Spawning Rule #.

Link to comment
Share on other sites

I went into debug mode on the texture spawner game object's main script and noticed that the world tile size was set to 256 when my world tile size was 1024, I changed that and then tried to spawn world, it seemed to have been counting through the 4 active rules most of the time but it still didn't spawn anything other than the 4th active rule everywhere (underwater texture).

Link to comment
Share on other sites

I just disabled that 4th rule that's getting placed everywhere and I'm going to spawn world again and see what happens this time, I'll let you know what I find out.

Link to comment
Share on other sites

It looks like the Height Mask is being ignored when spawning any textures.  The beach texture which should only be spawning between 490 and 505 terrain height is being spawned everywhere except where its slope filter is telling it to not spawn.  My mountain texture is spawning on the 45-90 degree slopes with the slope mask too.  Grass texture was being overwritten with the beach texture so I couldn't see it spawning anywhere.  Spawn rule order of the 4 spawn rules i'm trying to test with are : Beach1, Mountain1, Prairie1, UnderwaterOcean1 being furthest down on the list.

Link to comment
Share on other sites

So when the 4th rule UnderwaterOcean1 was supposed to spawn everywhere below 490 terrain height it was ignoring the height rule and just overwriting all textures.

Link to comment
Share on other sites

Ok so question you are not spawning all 32 textures on a single terrain correct? 
More so you are disabling textures before spawning them if it goes with that terrain? 
Just needing to make sure. 

As you can only have up to 8 textures on a single terrain, I believe 16 if you are using HDRP or a terrain shader. 

Also remember that when you texture a terrain think of it as a painting. 
It gets applied in layers and covered up as you get to the end. 

You may also want to check the rules to make sure no other rule is fighting it. 
One way to make sure its correct is turn on the visualization of each texture, and make sure its showing thats where its going to spawn. 

You also may want to insure that Draw Instanced is enabled on the terrain, that can be found in the terrain settings per each terrain. 

 

Link to comment
Share on other sites

I am not spawning all 32 textures yet just the 4 from the 4 active rules, but I want to eventually spawn 32 textures on the terrain.

Yes I'm disabling the other 28 texture spawning rules, which is one per texture.

They are all already added to the texture list on the terrains though, in the proper order I need to reference them in code.

 

The Unity Manual states:

If your Project uses the Universal Render Pipeline (URP) or Built-in Render Pipeline, you can use four Terrain Layers per Texture pass, with no limit on the number of passes. This means that although you are allowed to use as many Terrain Layers as you want, each pass increases the time spent rendering the Terrain.

 

So I should be able to use 32 textures on my terrain according to that info from the manual.  It'll just increase rendering time.

 

Having trouble with the visualization, its only showing a visualization for one tile off in one of the corners of my terrain grid.

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