Jump to content

Details Spawn


TakeruGrima
Go to solution Solved by Isaac,

Recommended Posts

I want to spawn grass, I used the same resources configuration as the default one(this one work), but it doesn't work with a custom one.

In the pictures the default one is the first picture & the custom is the second. For the custom one I use a prefab grass and the default use a texture grass.

spacer.pngspacer.png

Here is the config of the default grass

spacer.png

Here is the config of the custom grass

spacer.png

Did I do something wrong ? Do you guys know how to achieve the same result as the default grass ?

Link to comment
Share on other sites

Hi @TakeruGrima,

For getting the custom grass prefab to display in the editor correctly, make sure the material you are using on your grass mesh has 'Enable GPU Instancing' set to true:

image.png.0c4443e64b2d9be26f2b558a6cb420c4.png

And also make sure the prefab within the list of details on the terrain has 'Use GPU Instancing' set to true:

image.png.5a1a4e3fc0694d273049410f709b33d9.png

 

Are the flora assets within the spawner auto generated or do you use a custom flora asset for them? If it's the latter, do you use a custom shader for the material within the flora asset? If so, there are a couple of steps needed to make it compatible with Flora's rendering system. 

Link to comment
Share on other sites

Thanks for your answer @Isaac.

Now I can spawn grass but it is not visible in runtime... and the florers I spawned appear with a weird red color ( the flowers supposed to be yellow...)

The grass in editor :

spacer.png

The grass in runtime with weird red flowers...

spacer.png

Is it an issue with Flora scripts or Terrain Details Overrite ?

Link to comment
Share on other sites

Can you please tell me how you are running the player? 
Are you using one of our players or the Gaia Custom player? 

Link to comment
Share on other sites

@TakeruGrima What pipeline are you using? And are the materials used within the flora prefabs i.e. SM_Grass_Group_04_LOD0 using a custom shader? You can find out by selecting the flora prefab and looking under the material slot it contains:

image.png.19e128ec5997a3c60e1ade86676ea785.png

Then selecting this asset and looking at it's shader:

image.png.50f3025d5ea3f024a3dd9eeb38f17fe1.png

If its a custom shader, there are a few areas you need to add into the shader in order for it to be compatible with Flora, which I can walk you through once I find out what pipeline you are using. 

Link to comment
Share on other sites

10 hours ago, Bryan said:

Can you please tell me how you are running the player? 
Are you using one of our players or the Gaia Custom player? 

I use a custom player, and before adding custom grass it worked with the default one of gaia.

Link to comment
Share on other sites

7 hours ago, Isaac said:

@TakeruGrima What pipeline are you using? And are the materials used within the flora prefabs i.e. SM_Grass_Group_04_LOD0 using a custom shader? You can find out by selecting the flora prefab and looking under the material slot it contains:

image.png.19e128ec5997a3c60e1ade86676ea785.png

Then selecting this asset and looking at it's shader:

image.png.50f3025d5ea3f024a3dd9eeb38f17fe1.png

If its a custom shader, there are a few areas you need to add into the shader in order for it to be compatible with Flora, which I can walk you through once I find out what pipeline you are using. 

I didn't have meshes & materials on the flora system, I added them and the flowers seems fine but not the grass. I spawned many patch grass around my map but I just have one in some areas. 

Link to comment
Share on other sites

Small update on my issue. The grass is showing when the terrain has been sectorize. But the game has 2 parts :

  • Server
  • Client

The client use the sectorized terrains and the server use the original terrain. And we need to see the grass on the server also. Do you know why it works on sectorized terrains but not on the original ?

Link to comment
Share on other sites

15 hours ago, TakeruGrima said:

I didn't have meshes & materials on the flora system, I added them and the flowers seems fine but not the grass. I spawned many patch grass around my map but I just have one in some areas. 

. What render pipeline are you using? e.g. BuiltIn, URP or HDRP?

. Can you please show me the shader that the grass flora object is using? You can find this out by going into the spawner, expanding the flora object, then selecting on the materials in the Source Data section. 

image.png.19e128ec5997a3c60e1ade86676ea785.png

I need to know whether its a custom shader or one of the shaders that comes with Flora in order to identify the issue further. Often times a flora object with a custom shader will just spawn in 1 spot a couple of times across a terrain, because it doesn't contain a certain chunk of shader code needed to spawn its positions correctly. 

 

Link to comment
Share on other sites

I use URP .I found what causing the issue. When I run the game the Terrain Detail Overwrite has all his properties set to 0. It supposed to be :

  • Detail Distance : 190
  • Detail Density : 0.5

And when I change them in runtime it works. Do you guys have an idea what's going on here ?

spacer.png

Link to comment
Share on other sites

  • Solution

Flora's system hides Unity's system for drawing details, hence why the terrain detail overwrite script sets the details to 0 upon runtime. If you are happy using Unity's system for drawing details, then you can disable te Flora Terrain Tile object and the Terrain Detail Overwrite scripts. 

However, if you wish to use Flora to render the grass, I need to know if you are using a custom shader for your Flora details. You can refer to my previous post about where to find the shader that you use for the Flora object. There is a node that you need to add into your shadergraph in order for Flora to render these objects properly, without the red / yellow artifact appearing.  

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