Jump to content

Spawning details with LOD Group

Go to solution Solved by Peter,

Recommended Posts


I stumbled on the link above which is very similar to my issue with spawning details with a LOD Group with one minor difference, the details shows the LOD item as expected and the Nature Renderer shows the full prefab as expected but nothing is being rendered when placed by Gaia, it also adds the same item again each time as it cannot find it. I know there was a fix in 3.3.0 for this problem but i still cant get it to work.

3.3.0 - "Added better support for Nature Renderer terrain details with multiple LODs"

If i paint by hand, the detail shows fine, with and without the nature renderer component enabled. Any help appreciated.

Link to comment
Share on other sites

Hi @Ncorns,

in vanilla unity terrain details do not work if they use LODs, Nature Renderer "makes it work" by taking over the rendering of the object then. This created some problems for us in Gaia since we originally did not expect terrain details to utilize LODs on the terrain prototypes, but we made some adoptions in Gaia since then (like the patch you pointed out) to accommodate this.
Another issue that we had recently in this regard was when dealing with material variants, you can read about it here, but I do not think it applies in your case: https://canopy.procedural-worlds.com/forums/topic/1818-gaia-refuses-to-use-same-model-prefab-with-different-material/#comment-8374

The fact that Gaia adds the same item again and again seems like there is something unusual with the LOD group prefab that fails Gaias check whether the same object is used in the terrain details already. The checks it performs to find out if the terrain detail is on the terrain already are:

-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

I assume there is something happening with the LOD groups that somehow fails this last test that should result in the object being "the same". Could you please share a bit more information about the object that you are trying to render?
As far as I know Nature Renderer also does swap out an object with LOD groups on the terrain to replace it with a simpler object that uses only LOD0 so that it displays correctly in the unity terrain inspector. Can you please especially compare the prefab used in the Gaia spawner vs. what is set up as object for the terrain detail in the terrain inspector afterwards?

Link to comment
Share on other sites

Thanks for the quick response, i've been doing a little more testing. From the attached image, you can see that theres two examples. The example on the left doesn't work with an LOD Group. It has LOD0, LOD1, LOD2 and LOD3. The example on the right DOES work and it has LOD0 and LOD1. 

What stands out to me is that the working example shows the LOD0 in the terrain detail but the example which doesn't work shows LOD1 as if it cannot find LOD0 and skips to add LOD1 to the terrain instead (and adds 2x instances). 



Link to comment
Share on other sites

  • Solution

Hi @Ncorns, thanks for the detailed screenshots; it allowed us to identify the issue quickly! Gaia currently tries to identify if a detail on the terrain is "the same" object as the one referenced in the Gaia spawner by only looking at the meshes used in the first LOD level
In the flowers4 case, that would work, as the LOD used in the terrain details is LOD0 (as we expected). However, in the non-working bush example, LOD1 is used instead for some reason.

I changed how the Gaia check works to accommodate this better - It will now go through all the LOD levels on the object referenced in the spawner and see if any of those levels match the terrain details stored on the terrain. This should ensure this works regardless of which LOD level is stored on the terrain by nature renderer.

Can you please download this patch and try to see if this fixes the issue for you:

You can install the included unitypackage file via Assets > Import Package > Custom Package... in the unity editor.

If this works as intended, we will include this fix in the next Gaia release so it becomes the standard.

Link to comment
Share on other sites

Fantastic, it works! Thanks for your help and fast response on this issue, really appreciate it! 

  • Like 1
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...