Jump to content

Wrong (probably?) spawner behaviour.


Sam3DX
 Share

Go to solution Solved by Sam3DX,

Recommended Posts

I made a simple spawner for a grass. Nothing fancy, just a plain one.

 Spawner.thumb.png.37764b8eda322ef020efe2eee0e682fa.png

 

Every time I press "Spawn world" button on the bottom it creates a new copy of a grass object on the terrain.

copy.png.b0f98d6b8d74e2549eea625de677fbbb.png

 

Each time I press "Clear spawns" button to delete existing grass it removes grass from terrain, but keeps all the copies of object in terrain details. Also, after pressing the "Clear spawns" button I can not have any details on this terrain forever. I can press spawn button agian 10 times and it will add 10 more objects to terrain details but I will not see any actuall grass on the terrain. The only way to fix it is to delete the terrain and create a new one. Is this expecting behaviour? Cos it's seems quite unusable this way 😕

 

Link to comment
Share on other sites

Important detail: it happens only if I use Grass as prefab with lod. If I use just a texture it all works just fine.

Link to comment
Share on other sites

Hi @Sam3DX, please note that unity itself does not support grass items with multiple LODs - I assume what might be going on is that Gaia adds the prefab to the terrain, it is not rendered correctly due to it having LODs, and when spawning again there is something in the lodded prefab that "skips" the check that Gaia performs to see if a resource has been added to the terrain already, and then re-adds it again, if I remember correctly Gaia would compare the mesh on the prototypes to see if it is the same terrain detail item, that might not work if that mesh is a child in that prefab.
Clearing spawns does not fully remove the prototypes from the terrain, this can be done with the Resource Removal tool found under Advanced > Resource Management in the spawner:

image.png

To fix this, you would need to take one LOD level from the prefab and turn that single LOD into a new prefab where you just have a game object with a mesh filter & mesh renderer component on it, then it should work.
I would recommend to use the "Use GPU Instancing" option, this will use the newer "Instanced Mesh" rendering method for grass which is faster and usually looks better than the older method which only used a very basic vertex lit shader.

  • Like 1
Link to comment
Share on other sites

Hey, @Peter

I’m using Nature Renderer, it handles the rendering of a detail prefab with LOD perfectly. The issue is that Gaia can spawn it only one time and then got broken. 

Link to comment
Share on other sites

Hey @Sam3DX sorry for the delayed response, I was not aware you are using another vegetation rendering asset - in this case you can keep the prefab with LODs of course. I will try to replicate this with Gaia and should be able to provide you with a patch that fixes this issue.

  • Like 1
Link to comment
Share on other sites

Hi @Sam3DX I tried to replicate the issue in 3 unity versions, 2020.3, 2021.3 and 2022.2, in all 3 versions I do not get this behavior of Gaia adding the prototype again and again when spawning. 

My test object was a simple game object with a LOD group and a sphere and a cube mesh as the two different LODs, with this setup the prototype was added only once when spawning. I think you might have a different setup for the object, since unity does not seem to display this message on the terrain inspector:

image.png

Could you please share your unity version and ideally a screenshot / some more information about the structure of the terrain detail object?

Link to comment
Share on other sites

Hey, @Peter

I see the issue and feel confused. It's strange, but my Gaia spawner didn't add the prefab iteslf, instead it's adding a zero level from the LOD group. Here, I recored a really short video showing the prefab setup, scene setup, and a spawning issues. My grass using a complex shader, but at the core it's nothing more then regular LOD group and 3 mesh renderers as children.

LOD.png.c6575713b5ceb3e9222f52d2d2483f2c.png

 

I'm using Unity 2021.3.6 LTS with built-in render  and  Gaia 2021 PRO 3.2.5

Maybe something is wrong with the way I'm adding my grass prefab to the spawner? Please, check the video I recorded, maybe you could spot something unusual.

 

UPD. I reupload the video to youtube so it will be more convenient to check.

 

Link to comment
Share on other sites

  • Solution

I found it! It's not a Gaia issue, it's a Nature Renderer issue. Gaia adding a LOD prefab exactly as expected. Nature Rrenderer is the one who changing the assigned prefab to a different object.  And of course it's breaking the Gaia spawner cos it can't recognize the grass prefab and adding a new one insted (which is changing by NR as well). I reported it to the NR author. Sorry for bothering and thank you for your time.  

 

44886101_NRpart2.thumb.png.856afa4c664727d0a4d1aa0dabb69063.png

Link to comment
Share on other sites

  • Bryan locked this topic
Guest
This topic is now closed to further replies.
 Share

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