Jump to content

Gaia refuses to use same model prefab with different material.


TheBlackPlague
Go to solution Solved by Peter,

Recommended Posts

Consider these flower types:

spacer.pngspacer.png

 

They're the same models but use different materials. 

 

The scene with only pink (/purple) ones added: spacer.pngspacer.png

 

Scene with attempt to add blue flowers:

spacer.pngspacer.png

Link to comment
Share on other sites

  • Solution

Hi @TheBlackPlague,

when Gaia spawns terrain details, it first checks if there is a prototype of that detail added to the terrain already. If yes, it will use that prototype for the spawn so it does not add the same resources over and over again. It looks to me like Gaia does not add the second flower prefab because it "thinks" it is on the terrain already.

To find out if a terrain detail prototype is on the terrain already, It performs the following checks:
-If the terrain detail is a texture, it checks if a prototype is using the same texture file
-If the terrain detail is a game object, it checks if a prototype is using a game object with the same name
-If the terrain detail is a game object with LODs, it will compare the mesh used on the first mesh renderer in the LOD group

The last point was added to support Nature Renderer - Unity itself does not support LODs in terrain detail. With the above in mind, could it maybe be that you are using Nature Renderer, and the terrain detail also uses lods? In this case it could explain why it thinks the prototype is on the terrain already.
If that is the case, you could create a copy of the used mesh as a workaround so that the two prefabs use a "different" mesh. Then Gaia would consider them two different assets. If all of the above is true, I would then add a material check to the prefab comparison to prevent this from happening.

If my whole Nature Renderer thesis is not true, we would need to take another look at the prefabs to find out why Gaia would not add them to the terrain when the other one is present.

Link to comment
Share on other sites

5 hours ago, Peter said:

Hi @TheBlackPlague,

when Gaia spawns terrain details, it first checks if there is a prototype of that detail added to the terrain already. If yes, it will use that prototype for the spawn so it does not add the same resources over and over again. It looks to me like Gaia does not add the second flower prefab because it "thinks" it is on the terrain already.

To find out if a terrain detail prototype is on the terrain already, It performs the following checks:
-If the terrain detail is a texture, it checks if a prototype is using the same texture file
-If the terrain detail is a game object, it checks if a prototype is using a game object with the same name
-If the terrain detail is a game object with LODs, it will compare the mesh used on the first mesh renderer in the LOD group

The last point was added to support Nature Renderer - Unity itself does not support LODs in terrain detail. With the above in mind, could it maybe be that you are using Nature Renderer, and the terrain detail also uses lods? In this case it could explain why it thinks the prototype is on the terrain already.
If that is the case, you could create a copy of the used mesh as a workaround so that the two prefabs use a "different" mesh. Then Gaia would consider them two different assets. If all of the above is true, I would then add a material check to the prefab comparison to prevent this from happening.

If my whole Nature Renderer thesis is not true, we would need to take another look at the prefabs to find out why Gaia would not add them to the terrain when the other one is present.

Hello Peter,

You're absolutely correct that I am using Nature Render and my object has LODs. The mesh theory is likely correct—since they're sharing that. 

I think it would make sense to have a material check in the code, but I will duplicate the mesh and try that approach for now, since I doubt you'll be able to deploy a fix instantly.

Thank you for your support.

Link to comment
Share on other sites

Hi @TheBlackPlague great to hear that this was the solution. We cannot deploy a fix in a Gaia update so quickly, but here is a patch that you can install for that specific issue:

GaiaNatureRendererMaterialsPatch.zip

You can install the included .unitypackage via Assets > Import Package > Custom Package. This patch will be included in the next Gaia update as well.

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