Jump to content

Flora / Terrain Details


Mike P

Recommended Posts

I think I asked this in another thread/post but it must have gotten lost in the shuffle.  Trying to clean up some things and errors and whatnot and....

Have all grasses configured to render via Flora.  However, upon entering into play mode, editor or build, if the Flora Global Manager is detected, either the Flora Global Manager and/or the Terrain Detail Override Component(on each terrain) disables the terrain details.  Which is fine if the flora rendered what you told it to.  So not sure if this is a bug, an oversight or something I'm just missing or doing wrong.

This pic shows when the player first spawns in and Flora has rendered:

flora_b4_act_terrainDetail_01.thumb.jpg.74458659400d9034f8bb7f7d631c2526.jpg

This pic shows when i either manually go to a terrain and update the Terrain Detail Override or use PhotoMode to change/load the settings:

flora_act_terrainDetail.thumb.jpg.f9e2c2940502609d7cd9ccb80a543b3d.jpg

Key Note: I do have all the grass spawning less.  Especially the flowers and depending on the flower(red), way less. For these pics I prob should have reset to max spawns but hopefully u can see the difference as I do.

 

Lastly, on the flora, out of the blue it just decided to remove materials and/or shaders from the spawner settings without actually doing anything to the grass spawner or whatever spawner they may reside in.  Here is a snippet of errors that spam the console when this happens, either at time of entering into play mode or if re-spawning the spawner to the world or even locally:

Exception while spawning: Object reference not set to an instance of an object Stack Trace:   at ProceduralWorlds.Flora.FloraAutomationAPI.AddToTerrain (ProceduralWorlds.Flora.FloraTerrainTile floraTile, System.Collections.Generic.List`1[T] details, System.Boolean skipPrototypeCheck) [0x0002a] in D:\UnityProjects\......\Assets\Procedural Worlds\Flora\Scripts\Editor\FloraAutomationAPI.cs:2503 
  at Gaia.FloraUtils.AddFloraToTerrain (UnityEngine.Terrain terrain, System.Collections.Generic.List`1[T] floraLODs, System.Int32 terrainSourceDataIndex, ProceduralWorlds.Flora.CoreCommonFloraData+SourceDataType sourceDataType) [0x000e3] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\ResourcesSystem\FloraUtils.cs:274 
  at Gaia.GaiaMultiTerrainOperation.SetTerrainDetails (UnityEngine.RenderTexture targetDetailTexture, Gaia.SpawnerSettings spawnerSettings, Gaia.Spawner spawner, Gaia.SpawnRule spawnRule, System.Int32 randomSeed, System.Boolean centerTerrainOnly) [0x003e0] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\MultiTerrainSystem\GaiaMultiTerrainOperation.cs:824 
  at Gaia.Spawner.ExecuteSpawn (Gaia.GaiaMultiTerrainOperation operation, Gaia.BakedMaskCache collisionMaskCache, System.Int32 totalSpawns, System.Int32& totalSpawsCompleted, System.Boolean allowStatic) [0x00304] in D:\UnityProjects\......\Assets\Procedural Worlds\Gaia\Scripts\SpawningSystem\Spawner.cs:2750 
UnityEngine.Debug:LogError (object)
Gaia.Spawner:ExecuteSpawn (Gaia.GaiaMultiTerrainOperation,Gaia.BakedMaskCache,int,int&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2904)
Gaia.Spawner/<AreaSpawn>d__217:MoveNext () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2339)
Gaia.Spawner:EditorUpdate () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1009)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

 

Any guidance would be most appreciative.  Thank you.

 

Link to comment
Share on other sites

On 1/6/2022 at 8:48 PM, Mike P said:

I think I asked this in another thread/post but it must have gotten lost in the shuffle.  Trying to clean up some things and errors and whatnot and....

Have all grasses configured to render via Flora.  However, upon entering into play mode, editor or build, if the Flora Global Manager is detected, either the Flora Global Manager and/or the Terrain Detail Override Component(on each terrain) disables the terrain details.  Which is fine if the flora rendered what you told it to.  So not sure if this is a bug, an oversight or something I'm just missing or doing wrong.

This pic shows when the player first spawns in and Flora has rendered:

flora_b4_act_terrainDetail_01.thumb.jpg.74458659400d9034f8bb7f7d631c2526.jpg

This pic shows when i either manually go to a terrain and update the Terrain Detail Override or use PhotoMode to change/load the settings:

flora_act_terrainDetail.thumb.jpg.f9e2c2940502609d7cd9ccb80a543b3d.jpg

Key Note: I do have all the grass spawning less.  Especially the flowers and depending on the flower(red), way less. For these pics I prob should have reset to max spawns but hopefully u can see the difference as I do.

 

Lastly, on the flora, out of the blue it just decided to remove materials and/or shaders from the spawner settings without actually doing anything to the grass spawner or whatever spawner they may reside in.  Here is a snippet of errors that spam the console when this happens, either at time of entering into play mode or if re-spawning the spawner to the world or even locally:

Exception while spawning: Object reference not set to an instance of an object Stack Trace:   at ProceduralWorlds.Flora.FloraAutomationAPI.AddToTerrain (ProceduralWorlds.Flora.FloraTerrainTile floraTile, System.Collections.Generic.List`1[T] details, System.Boolean skipPrototypeCheck) [0x0002a] in D:\UnityProjects\......\Assets\Procedural Worlds\Flora\Scripts\Editor\FloraAutomationAPI.cs:2503 
  at Gaia.FloraUtils.AddFloraToTerrain (UnityEngine.Terrain terrain, System.Collections.Generic.List`1[T] floraLODs, System.Int32 terrainSourceDataIndex, ProceduralWorlds.Flora.CoreCommonFloraData+SourceDataType sourceDataType) [0x000e3] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\ResourcesSystem\FloraUtils.cs:274 
  at Gaia.GaiaMultiTerrainOperation.SetTerrainDetails (UnityEngine.RenderTexture targetDetailTexture, Gaia.SpawnerSettings spawnerSettings, Gaia.Spawner spawner, Gaia.SpawnRule spawnRule, System.Int32 randomSeed, System.Boolean centerTerrainOnly) [0x003e0] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\MultiTerrainSystem\GaiaMultiTerrainOperation.cs:824 
  at Gaia.Spawner.ExecuteSpawn (Gaia.GaiaMultiTerrainOperation operation, Gaia.BakedMaskCache collisionMaskCache, System.Int32 totalSpawns, System.Int32& totalSpawsCompleted, System.Boolean allowStatic) [0x00304] in D:\UnityProjects\......\Assets\Procedural Worlds\Gaia\Scripts\SpawningSystem\Spawner.cs:2750 
UnityEngine.Debug:LogError (object)
Gaia.Spawner:ExecuteSpawn (Gaia.GaiaMultiTerrainOperation,Gaia.BakedMaskCache,int,int&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2904)
Gaia.Spawner/<AreaSpawn>d__217:MoveNext () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2339)
Gaia.Spawner:EditorUpdate () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1009)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

 

Any guidance would be most appreciative.  Thank you.

 

We will look into this! 
 

Link to comment
Share on other sites

@Brian OK. thank you.

Question though. Is the intend, if using the Flora on 'any' or 'all' to zero out the Terrain Detail Override Component settings.  If not, then it's definitely a bug, but simple to fix. If it is the original intention than there is a larger issue as I stated grass or what not set up with Flora activated do not fully render unless you actually provide settings for the override component, on a terrain by terrain basis.

Edited by Mike P
Link to comment
Share on other sites

@Mike P It is intended that Flora turns the unity terrain details down to 0. Flora does not have its own system for positioning the vegetation items, so it instead uses the unity terrain detail system to replace the items in there. Since we can only shutdown the unity terrain detail system as a whole by putting the detail density / draw distance to 0, this is what we do to deactivate it. We can't unfortunately switch off single items only, if we could, it could be interesting to have both systems running at the same time.
I think what is going on in your screenshots is that in the first screenshot only flora is running, in the second screenshot it is both Flora and the unity system running at the same time, and the flowers that are being displayed come out of the unity terrain detail system.
As to why the flowers do not appear when they should be rendered by Flora, we would need to check what is set up as a replacement for those flowers in Flora. There could be various reasons why Flora would not render something in that spot, Flora has many settings for the items including its own density per item.
To analyze what is going on, I would recommend to
1. Start the scene
2. Go through all of the Flora Game Objects under the terrain object here:

image.png

3. When you select those, you will see all the settings for this item in the inspector. You can identify what you are editing by clicking the "disable" checkbox. This allows you to check in the game view which item is disappearing / reappearing quickly to make sure you edit the right item.

4. When you have found the item that is supposed to replace the flowers, try to adjust the following 3 settings:
- Density
- Alpha Threshold
- Use Noise
image.png

Those would be the ones most likely to cause it that flora does not render (enough) items in that spot from your screenshot.

Link to comment
Share on other sites

  • 2 weeks later...

@Peter @Bryan @Adam Thank you for the detailed response. I have not yet looked into what you explained, but I will as I'm encountering other "Flora" related issues.  Which by the way is just driving me insane...

--------------------------------------------------------------------------------------------------------------------------

Due to needing to load all terrains and the ability to modify certain terrains, I needed to clear all terrains of detail, trees, etc... When re-running grass spawner received 11+ errors as well as same errors during run-time for all terrains(144 = 12x12_512 @2048). In addition I added 2 new grasses to the grass spawner via duplicating an existing spawner rule inside the grass spawner. Once I duplicated the rule, I went into the resources of each of the duplicated rules and one-by-one removed the flora config which then was  prompted to remove completely for the selected resource.  I chose to remove completely for the selected resource (duplicated rule x 2). I then proceeded to update the necessary resource fields for the new grasses, refreshed the terrain prototype and was prompted to add the new grasses to the terrain.  I then re-enabled Flora and selected to auto-create the config for both new grass rules.  It does this without a hitch, for the most part, most of the time.

Key Notes:

Cleared all terrains (144 plus origin) of tress, details and all GOs, etc... via Resource Helper Edito Tool and/or Clear Spawner Editor Tool

Removed the grass spawner from the biome

Deleted all Flora Data in the FloraData folder in the session

Re-added the grass spawner to the scene so it would re-generate the flora data for the grasses within the grass spawner.  I then did what I said above for the new grasses.

Spawned the grass spawner for entire world (12x12) (or locally).  Resulted in these error messages appearing at least 11+ times.  After spawner completed, entered play mode and there was no flora grass in current terrain and surrounding terrains relative to where player spawned. Continued to get run-time errors(same) for all terrains loading in.

As a result of all of this, initial run time errors are at least 11+ depending on loading range and they continue as the player traverses the world.

(spawner errors: 11+ in addition to continuous run time errors of the same causing no flora on terrains):

Exception while spawning: Object reference not set to an instance of an object Stack Trace:   at ProceduralWorlds.Flora.FloraAutomationAPI.AddToTerrain (ProceduralWorlds.Flora.FloraTerrainTile floraTile, System.Collections.Generic.List`1[T] details, System.Boolean skipPrototypeCheck) [0x0002a] in D:\UnityProjects\FTLake\Assets\Procedural Worlds\Flora\Scripts\Editor\FloraAutomationAPI.cs:2502
  at Gaia.FloraUtils.AddFloraToTerrain (UnityEngine.Terrain terrain, System.Collections.Generic.List`1[T] floraLODs, System.Int32 terrainSourceDataIndex, ProceduralWorlds.Flora.CoreCommonFloraData+SourceDataType sourceDataType) [0x000e3] in D:\UnityProjects\FTLake\Assets\Procedural Worlds\Gaia\Scripts\ResourcesSystem\FloraUtils.cs:274
  at Gaia.GaiaMultiTerrainOperation.SetTerrainDetails (UnityEngine.RenderTexture targetDetailTexture, Gaia.SpawnerSettings spawnerSettings, Gaia.Spawner spawner, Gaia.SpawnRule spawnRule, System.Int32 randomSeed, System.Boolean centerTerrainOnly) [0x003e0] in D:\UnityProjects\FTLake\Assets\Procedural Worlds\Gaia\Scripts\MultiTerrainSystem\GaiaMultiTerrainOperation.cs:824
  at Gaia.Spawner.ExecuteSpawn (Gaia.GaiaMultiTerrainOperation operation, Gaia.BakedMaskCache collisionMaskCache, System.Int32 totalSpawns, System.Int32& totalSpawsCompleted, System.Boolean allowStatic) [0x00304] in D:\UnityProjects\FTLake\Assets\Procedural Worlds\Gaia\Scripts\SpawningSystem\Spawner.cs:2750
UnityEngine.Debug:LogError (object)
Gaia.Spawner:ExecuteSpawn (Gaia.GaiaMultiTerrainOperation,Gaia.BakedMaskCache,int,int&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2904)

Here is a sample of additional run time errors:

Requested index of 14 of the type ProceduralWorlds.Flora.DetailOverrideData is not in range.  Detail Instance not created on Terrain tile Terrain_8_11-20220121 - 044742
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
ProceduralWorlds.Flora.FloraTerrainTile:Start () (at Assets/Procedural Worlds/Flora/Scripts/Runtime/FloraTerrainTile.cs:261)

Gaia.Spawner/<AreaSpawn>d__217:MoveNext () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2339)
Gaia.Spawner:EditorUpdate () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1009)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
  (Filename: Assets/Procedural Worlds/Flora/Scripts/Runtime/FloraTerrainTile.cs Line: 261)

 

This is driving me crazy as this happened before to me on a test terrain setup I was doing before moving onto my actual games world.  I was only able to correct the test projects terrain by totally re-creating the terrain, which at this point is not a viable option for me on my actual games terrain. 

What do you think is causing this and what do you recommend to possibly resolve?

Thank you!

Edited by Mike P
Link to comment
Share on other sites

Hi @Mike P Sorry for the delayed reply! I have not fully analyzed it yet, but I assume this issue is coming from the duplication of the spawn rule initially - the data for both of the flora renderer and the material need to be serialized as attachments inside the spawner settings, and I could imagine there is an issue with that when the rule is being duplicated. While I look further, could you please check if it makes any difference if you completely remove all Flora LOD levels from the duplicated rule (so that it offers you to disable it completely), then try to re-enable it? What I hope to achieve by this is that this duplicated rule then gets its renderer and material data created anew which then should hopefully work without issues.
This is of course not the actual solution to the issue but only a suggestion for a workaround until I know more.

Link to comment
Share on other sites

@Peter Hey.  No worries on the delayed response. We're all buys and I'm sure you guys are just as if not busier!

I will check and make sure. I think you are correct though as I've stopped duplicating and just started created new rules and than manually adding what's needed and allowing the Flora AutoConfig to do it's thing... So prob a slight bug with the duplication and the serialization data.... Will let ya know!! Thanks for all your support!

Link to comment
Share on other sites

Hi @Mike P, I had a more intense look at this yesterday, and there were indeed issues when a spawn rule was duplicated, and afterwards the flora LOD items on the duplicated rule were pointing to the exact same flora configuration objects, this would cause problems further down the line when spawning.
I fixed this from a technical perspective, when duplicating a rule it does now create duplications of the flora settings objects as well at the same time, this change will be rolled out with the next Gaia update which will arrive very soon (should be around today / tomorrow if all goes well).
While this works from a technical standpoint,  from a usability perspective I'm not 100% happy with this yet. If you duplicate a terrain detail spawn rule, you get an "independent" copy now where you e.g. could have the same combo of  unity terrain detail and its flora replacement displayed somewhere else on the map. But if you wanted to display another, new vegetation item you would need to crawl through the unity settings and then through the flora settings to adjust this to display something else instead which is a bit tedious, we need to improve on that in the future.
Ideally we can get it working at some point that flora gets its own, independent resource type that has nothing to do with the unity terrain detail system anymore.

Link to comment
Share on other sites

Hey @Peter  Thanks for diving into this situation. Much appreciated !  I have upgraded to the newest version and had to do a few things to get the update to function properly but after getting all things done, seems to be okay so far.  I have not yet tried to duplicate any rule sets yet, but will.  I also like the new re-ordering of the rules. Perfect man!!!! Awesome!!! Will definitely come in handly with the texture layering. I hope it works there too as expected.  Again thanks for taking the time to get this resolved, I know it was a huge task!

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