Jump to content

Spawner visualization broken after attempting to upgrade to latest Gaia Pro


atcarter714

Recommended Posts

______________________________________________________________________________________________

EDIT:

When I searched in my project folder in Windows explorer I was able to start locating these different shader files, and when selecting them in the Unity inspector I realized that there were broken include paths. In my projects I keep imported third party tools and assets in their own subfolder for organization and several other practical production reasons. The includes in the HLSL files were expecting Gaia to just be in the root Assets folder, so changed the paths to the actual relative path "Assets/Imports/Third Party/Procedural Worlds/Gaia" in a couple of files including the SpawnerPreview shader, and this has fixed the problem: I can now see spawner visualization preview again and the error messages have disappeared.

 

So while that immediate concern has been fixed, that leaves me with a couple other questions and concerns. What other shaders might have broken includes in there and are causing problems? Does Canopy have a list of shader files that have any kind of relative/absolute paths that rely on being at the top of the root Assets folder? And will anything other than shaders be broken by having things in a subfolder? I can easily write a C# utility that will scan the Gaia folders and fix include path strings like this automatically, but if it's only these couple shaders that needed it then it won't be necessary. And I also need to know what else relies on that original path/location and what I'd need to do to fix that.

 

Also, would I be better off just doing Gaia terrain and world-building in another project like I asked earlier? Seems like that might be a much better approach because this got kind of complicated really fast and the repo is massive. I'm just not sure how consistent results would be between one project and another doing things this way and if I might end up with things looking different due to different pipeline assets and lighting setups and stuff ...

______________________________________________________________________________________________

 

After trying to upgrade in an existing project like the download page said I could do a number of things appear to be broken but the most disruptive thing is that spawners can't be visualized anymore. When you click on the eye icon it throws an error saying shader tried to use an invalid pass number that's out of range. I set a breakpoint in that script in VS 2022 just to see and sure enough it only has 1 pass, and the method is trying to use 1 as the pass index instead of 0. Changed it to zero just as an experiment and there was no error but also no visualization overlay. So apparently it's just not going to work, period. Here's the call stack and error message output:

 

Error Log:

Invalid pass number (1) for Graphics.Blit (Material "Hidden/Gaia/GrowShrink" with 1 passes)
UnityEngine.Graphics:Blit (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Material,int)
Gaia.BakedMaskCache:OrthoLayerBake (UnityEngine.Terrain,UnityEngine.LayerMask,single) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:312)
Gaia.BakedMaskCache:BakeLayerGameObjectCollisions (UnityEngine.Terrain,UnityEngine.LayerMask,single) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:276)
Gaia.BakedMaskCache:LoadBakedMask (UnityEngine.Terrain,Gaia.BakedMaskTypeInternal,Gaia.CollisionMask,string) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:716)
Gaia.GaiaMultiTerrainOperation:GetCollisionMask (Gaia.CollisionMask[]) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/GaiaMultiTerrainOperation.cs:2565)
Gaia.ImageMask:Apply (UnityEngine.RenderTexture,UnityEngine.RenderTexture) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/ImageMask.cs:660)
Gaia.ImageProcessing:ApplyMaskStack (UnityEngine.RenderTexture,UnityEngine.RenderTexture,Gaia.ImageMask[],Gaia.ImageMaskInfluence) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/ImageProcessing.cs:42)
Gaia.Spawner:ApplyBrush (Gaia.GaiaMultiTerrainOperation,Gaia.MultiTerrainOperationType,int) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1739)
Gaia.Spawner:DrawSpawnerPreview () (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1530)
Gaia.SpawnerEditor:DuringSceneGUI (UnityEditor.SceneView) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/Editor/SpawnerEditor.cs:1019)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Invalid pass number (2) for Graphics.Blit (Material "Hidden/Gaia/TreeCollisionMaskBaking" with 1 passes)
UnityEngine.Graphics:Blit (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Material,int)
Gaia.BakedMaskCache:BakeVectorArrayForTerrain (UnityEngine.Vector4[],UnityEngine.Terrain,string) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:457)
Gaia.BakedMaskCache:BakeTerrainTreeCollisions (UnityEngine.Terrain,Gaia.CollisionMask,single) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:404)
Gaia.BakedMaskCache:LoadBakedMask (UnityEngine.Terrain,Gaia.BakedMaskTypeInternal,Gaia.CollisionMask,string) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/BakedMaskCache.cs:710)
Gaia.GaiaMultiTerrainOperation:GetCollisionMask (Gaia.CollisionMask[]) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/GaiaMultiTerrainOperation.cs:2565)
Gaia.ImageMask:Apply (UnityEngine.RenderTexture,UnityEngine.RenderTexture) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/ImageMask.cs:660)
Gaia.ImageProcessing:ApplyMaskStack (UnityEngine.RenderTexture,UnityEngine.RenderTexture,Gaia.ImageMask[],Gaia.ImageMaskInfluence) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MaskSystem/ImageProcessing.cs:42)
Gaia.Spawner:ApplyBrush (Gaia.GaiaMultiTerrainOperation,Gaia.MultiTerrainOperationType,int) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1755)
Gaia.Spawner:DrawSpawnerPreview () (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1530)
Gaia.SpawnerEditor:DuringSceneGUI (UnityEditor.SceneView) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/Editor/SpawnerEditor.cs:1019)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Trying to access pass 1, but material 'Hidden/Gaia/SpawnerPreview' subshader (0) has only 1 valid passes.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Gaia.GaiaMultiTerrainOperation:Visualize (Gaia.MultiTerrainOperationType,UnityEngine.RenderTexture,UnityEngine.Material,int) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/GaiaMultiTerrainOperation.cs:3162)
Gaia.Spawner:DrawSpawnerPreview () (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1574)
Gaia.SpawnerEditor:DuringSceneGUI (UnityEditor.SceneView) (at Assets/Imports/Third Party/Procedural Worlds/Gaia/Scripts/Editor/SpawnerEditor.cs:1019)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

Not sure what I can do about this if there's only one pass in the visualization shader and it also doesn't work lol. In the debugger it says material name is "Hidden/Gaia/SpawnerPreview" so I searched and found a SpawnerPreview.shader file and the HLSL has multiple passes defined in it, not one. I came here to seek help because solving this on my own will waste a lot of work hours since I'm unfamiliar with this large code base 😄

 

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

 

There are also a number of smaller issues driving me crazy:

 

1) The Gaia Player objects all quit working correctly. They don't move when you press keys, it only moves if you hold down right mouse button and press WASD or QE, but it still won't rotate the camera no matter what you do. I tried adding a FreeCamera script on the main camera in the scene and enabled it just to see if input systems were working correctly and it is, that worked just fine except for the fact it breaks the entire Procedural Skies system and you get all kinds of crazy phantom shadows on the terrain.

 

2) Prefabs like the Fields of Color microbiome were pink/broken and still using the built-in pipeline shaders. So I switched them to the matching URP counterparts and I managed to wrangle the flowers into rendering correctly and beautifully with URP, but the shrubs look torn up ... it's like they're pixelated and full of holes, nothing like they're supposed to look. Flowers were doing this at first, too, until I finally fixed it somehow (not sure precisely which thing I did fixed it). And I'm guessing it's because their material must be screwed up. Any idea how to get them and other content right?

 

3) I attempted this upgrade because I wanted to be able to use Flora and LOD'ed detail meshes like NatureManufacture's Advanced Foliage Pack and other stuff I've got around here because Unity simply refused to allow it, and because the lighting/rendering just looked really off for some reason. Things looked much better after the upgrade in the overall scene (visually). And the changelog said this Flora issue had been taken care of, so I was eager to find out but it looks like it just broke a lot of other stuff for me. Everything is version controlled and I've even pushed a backup zip to the cloud so I suppose I can roll back but I really wanted to use the latest version of Gaia and be able to use Flora with my nice detail plant meshes properly.

 

I also found that with D3D12 things seemed really messed up and I didn't have time to fight with it so I just reverted to D3D11 for now. Unity also has a bug where you can't enforce vsync in play mode in the editor using D3D12 backend so it tries to cook your GPU and will try to render a million frames per second if it can. That got me wondering what are the recommended rendering/quality settings for really high-end PCs? I'm running an i9 12900K with a RTX 3080Ti, so I've got plenty horsepower here and realistically I won't be releasing anything that comes of this project for a couple years, so I want to establish today's high quality settings as my base line and I'll figure out how to enhance and optimize things for future generations of hardware. NatureManufacture recommends deferred rendering for their content, whereas Gaia seems to use forward by default. I didn't notice any problems or huge differences changing between them, but if you select "Use accurate G buffers" for deferred the whole scene turns dark and is lit incorrectly. So are there any guidelines for configuring the "ideal" rendering/quality settings for Gaia scenes, and is there any information pertaining to running D3D12 on Windows?

 

Anyway, the main thing irking me is that broken spawner visualization as it's brought all things to a screeching halt for me. I was doing pretty well up until now, trying to figure out how to integrate Gaia into a nice workflow for my game prototype. Should I work on Gaia terrains in a different project and then export them to use in the gameplay project? And what would be a nice way of doing that and maintaining consistency in rendering, quality, etc? I'm a programmer, but not much of a world designer and I'm working hard to figure all of this out and make proper use of it. So any recommendations you can make about how I should establish a workflow would be much appreciated. I suppose that's plenty enough questions for now!

 

 

Link to comment
Share on other sites

Edited my post above: I found some broken HLSL files that had include paths based on Gaia being in the root Assets folder (and it is not in my project -- it lives in a 3rd party assets folder and my root Assets folder focuses on my in-house stuff for the game), so fixing those include paths fixed the broken visualization. No idea why it worked fine prior to the upgrade and then broke afterward, but now I need to know what else could potentially be broken due to having Gaia in a subdirectory.

 

If I ever publish an asset to sell or give away, I'm definitely going to keep this issue in mind and if some kind of path strings are relied upon anywhere I'll provide a mechanism to switch that if someone has an alternate directory structure. That would be a great feature for Gaia and all of the Procedural Worlds tools to have in the future because production often calls for a unique type of directory structure to suit the needs of a particular project! Would be a good practice for all asset developers to keep in mind, I think, to try to minimize assumptions about where someone will install and use things. If I knew a list of things in Gaia that depend on paths I could even write a C# utility to run over the files and fix the strings automatically.

Link to comment
Share on other sites

The plot thickens ... after going through shaders in the project and fixing any broken includes, Unity starts having an internal D3D11 swapchain error and crashing to desktop with no logs, no error report dialog, just instant death. I think it's that FilterGrowShrink.shader (or one of those around it) that's causing the crash.

 

I'm guessing Unity could be using more than one internal ID3D11Device5* (or whichever device interface version they use) to render to the editor and preview windows, or they're using one D3D11 device and multiple render targets to render to textures then invalidating parts of the editor UI to refresh the image you see. And when I'm cycling through these shaders and it wants to render a preview of these that's causing some kind of failure internally in Unity. Whose at fault: the shader or Unity itself? I couldn't say, as I'm not 100% sure which one it is yet and haven't looked at the HLSL code (and don't have Unity's source code either lol). I'm having to make a guess here at what's going on. But this started happening as soon as I fixed one of these shader's broken #include directives and it recompiled and tried to update in the Preview viewport. I don't see why the DXGI swapchain interface itself would be at fault here ... seems like something is either causing the device interface to crash and get removed or there's a long pause without a response and Windows is killing it to protect the driver and OS from getting hung up ...

 

unity_d3d11_crash_screenshot.png

Link to comment
Share on other sites

These are the offending *.shader files I found with broken #include directives. In future versions of Gaia, I hope that these #includes could be relative to a subdirectory instead of the root Assets folder of the project and thus result in these broken shaders and editor/runtime errors. For the sake of knowledge/awareness, here is a list of most (but not necessarily all) of the files I had to edit to fix everything. I know I forgot a couple in this list and I'd have to search my git commits to find every single one of them.


 

---------------------------------------------
BROKEN FILES LIST:
---------------------------------------------

BaseOperation.shader
CombineCollisionMasks.shader
FilterDistanceMask.shader
FilterGrowShrink.shader
StampPreview.shader
TreeCollisionMaskBaking.shader
FilterHeightMask.shader
FilterSlopeMask.shader
FilterHeightTransform.shader
FilterMixHeight.shader
FilterStrengthTransform.shader
FilterImageMask.shader

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

 

I had to set breakpoints in the editor script for spawners for see what shaders + materials were being used as parameters, then search in my project folder for anything matching that name. After that it was pretty straight-forward: open that file, scroll to the #include directive lines and find anything that had "Assets/Gaia/..." as the beginning of the path. Then just replaced that path from the root Assets folder with the correct path to that file. Save and let Unity recompile the shader and it fixes the problem.

 

I guess since this is a problem for us with other third party assets I'm going to write a C# utility that can automatically scan files and fix relative and absolute paths that shaders and other files/assets are depending on to automate the process. Maybe I'll have time this weekend (I hope) and I'll put it on Github so others can use it. Fixing stuff like this by hand is tedious and frustrating, so I'll make sure I don't need to do it again, lol.

 

Despite fixing this and getting the upgraded version of Gaia working, however, I still can't seem to use LOD'ed plants from other content packages with Flora as terrain details. It seems to work just fine for assets that come with Procedural Worlds or one of the content packages but anything else doesn't work. I'm not sure why yet and how they are different, but working on figuring that out now ...

 

EDIT: The Flora manager says it only works with HDRP, but spawner settings have Flora options and checkboxes to enable/disable and when using some of those plant meshes from Fields of Color or another Procedural Worlds content package it generates references to the LODs, says Flora is enabled for it ... kind of confusing ... 😕

Link to comment
Share on other sites

Can you please tell me what Unity version you are using? 

As for the the issues stated above we are going to investigate this. 

 

Link to comment
Share on other sites

11 hours ago, Bryan said:

Can you please tell me what Unity version you are using? 

As for the the issues stated above we are going to investigate this. 

 

 

Sorry, I totally forgot to mention that:

 

2021.3.7f1 LTS

Link to comment
Share on other sites

I used some of those Flora presets in a spawner and tried that. Nothing shows up in the editor, but at runtime I see grasses spawning. Unfortunately, it seems I have very little control over them. I'm guessing that particular prefab is picking out randomized pieces of a large texture atlas to create a variety of grasses or something when I thought I was just spawning a basic "wild grass". When I went to the beach at runtime it had spawned a bunch of little tiny plants that only had about 1m or 2m view distance which looked pretty bad, and I'm not even 100% sure where they came from yet (all I know is that this one spawner did it, because I ensured everything else was disabled/removed first and re-confirmed it). Trying to investigate this now. And maybe I will just have to try swapping the prefab LODs now with the desired plant models from NatureManufacture I was trying to use and see if that works for me.

 

Also, maybe I need to unpack the original NatureManufacture prefabs with the LODs and make a new prefab with just LOD0 on it, set that as the resource prefab for Flora and then generate the LOD level settings for Flora details one by one with each LOD mesh? I'm probably gonna try these ideas out today but I've still had quite a bit of trouble with it despite looking at some documentation pages (some of which seem outdated and have some contradictory info).

 

Still no luck figuring out why Gaia "Player" objects and their controls don't work. Still have the problem where you can't move at all unless you hold the right mouse button, then for some reason that enables WASD and QE movement but rotation is just locked or broken. I wasn't able to get proper movement with it until I just disabled the scripts Gaia put on it and added a different script to control the camera. Kind of frustrating ... I haven't really looked into how the "Player" system for Gaia works but it seems like a lot of stuff depends on knowing the transform of the player and the camera associated with them (i.e., weather effects, water reflections, etc). So it's another thing I need to figure out because I've had some issues with those things too. Removing the player setup from the scene and creating a new one from Gaia Manager didn't work.

Link to comment
Share on other sites

Hi @atcarter714, we are sorry about the shader issue - the absolute path to that include file was only introduced in the latest Gaia update, and we were not aware of that issue yet. We will fix this in the next update.

Regarding your other issues:


 

Quote

Also, maybe I need to unpack the original NatureManufacture prefabs with the LODs and make a new prefab with just LOD0 on it, set that as the resource prefab for Flora and then generate the LOD level settings for Flora details one by one with each LOD mesh?


You would not need to unpack the prefab, but you would need to create a lod level entry each in the flora configuration, assigning the respective Nature Manufacture LOD mesh. Make sure the material uses the Flora shaders - you should be able to assign the textures used in the original nature manufacture material in the flora shader material as well.

 

Quote

Still no luck figuring out why Gaia "Player" objects and their controls don't work


It is intentional that e.g. the Flycam only reacts to input when the right mouse button is pressed. This is done to mimic the behavior of the scene view in unity. In this way you can run the scene and explore your terrain in Game view, but it is easy to release the right mouse button and get your mouse cursor and keyboard back for operating the unity editor.
You can test an alternative to this by selecting the camera, and unchecking the "Hold Right Mouse Capture" option:
image.png

When this option is disabled, you can click in the game view while the scene is running and it should start to read the keyboard controls as long as this window still has focus. 
It does sound like an additional issue though since you mentioned the rotation would not work even when you pressed the right mouse button. Could you please check if in the input manager (Edit > Project Settings > Input Manager) you have a definition for the mouse x and y axes?

image.png

If that was missing or renamed I would imagine the script would not read the mouse movements correctly.

  • Like 1
Link to comment
Share on other sites

Ah, you were right about the input settings it seems. A sneaky 3rd party asset made some changes to that to support gamepad inputs and it broke it. At first glance it was unnoticeable and I had to look closely. No need to apologize about the shader includes though, it happens in big projects and it's easy to overlook something like that when it's time to make a build. I've been there before myself. Glad I was able to bring it to your attention to deal with it though.

 

I'm still having hell with Flora though. It seems now it spawns everything with broken materials and give me pink polygons all over the place. That's even when I'm using spawner/biomes from PW that should be working. I checked the Flora configs for these things and it's using valid materials which I can see display correctly in the preview window or prefab editor, so I have no idea why it does this. I've also been unable to get Flora to work with NatureManufacture's LOD'ed plants in the way you described. When I try that it creates a new terrain detail object which always has a warning/error message on it and nothing will show up at runtime. I think I need to either find a really detailed tutorial or read a lot more detailed documentation about it and how it works (including all the do's and dont's).

 

I've been breaking and fixing a lot of stuff as I figure out how everything works, lol. I'm having a slight issue where some trees spawn partially out of the ground / hovering and look bad and I'm not sure if that's going to require me to edit every prefab and move them down (-Y) or if Gaia has a way to adjust it. I also cannot seem to find what actually controls the visibility of the outer space skydome at night. It shows up at midnight and fades away in the early morning. I'm trying to change it to fade in after sunset, and I'm trying to use a high resolution texture for the moon. I found the skydome shader, I added some logic in there to draw a white circle where the moon is as a mask, but haven't quite figured out how I can center, scale and map the moon texture onto that circle ... I wish that had been a built-in feature (should definitely be) where you can just switch moon textures. But I got to the point of making my white circular mask and wasn't experienced enough with Amplify to know what to do next. My white circle "mask" in the shader draws at the perfect size and position like I want, but I'm not sure how to position and scale my texture into it to draw the actual moon image. If I just sample it normally the UVs wrap the entire sky and my circle is just a tiny area of the moon texture cut out of it lol. I also can't figure out what fades the dome in/out so I can make it fade in at dusk properly, or what is controlling the bright glow from the directional light (is it bloom in post-processing?) ... I left it alone for a while until I can figure out what the hell is going on with Flora though.

Link to comment
Share on other sites

Here's some screenshots of the editor and inspector windows if it helps figure out what's going wrong here. Barely any grass shows up at runtime, performance tanks and the materials turn up broken. But things look good in the editor window.

 

flora_problem_runtime01.thumb.jpg.b25e8c7dfe10677b10e6fcd8359f795e.jpgflora_problem_editor_inspector_02.thumb.png.48aafc05c60f101f77d29e5414ed2dbc.pngflora_problem_editor_inspector_01.thumb.jpg.3afe7c38e5bd9a683d7ccc2c3a925383.jpgflora_problem_editor_01.thumb.jpg.625b88c598a1df8a6999a9883525bf97.jpg

Link to comment
Share on other sites

Investigation of this lead to some new revelations. There are controls there there for cells and subdivisions that I don't fully understand but I see that it's creating zones to split things up and control how spawning works. And I found that it's spawning grass using built-in render pipeline materials. I can't seem to find the appropriate ones for URP either.

 

EDIT:

As soon as I fix one thing another thing breaks. At one point I had it drawing grass with Flora, tried to repeat the process with another grass type and then it screwed the materials up where the grass was glowing white. The more I tried to fix things the more problems it caused until I ended up with a huge mess of preset copies and materials I can't tell from each other lol. Are there any add-ons or 3rd party assets that can help out with the grass and details dilemma? This has become pretty difficult and frustrating and I'm not a pro level designer, I'm a programmer and all these crazy UI options and menus are quite overwhelming lol.

Link to comment
Share on other sites

Hi @atcarter714, great to hear you could fix the control issue! Regarding the other issues:

 

  • I think you are on the right path with setting up Flora, the only issue remaining seems to be that the Flora materials seem to use the wrong shader - in URP the material needs to use the shader "PWS/Details/PW_Details_Foliage_URP":

    image.png

    When you load in a biome / spawners while Gaia is set up to use URP already, it should normally switch the Flora materials to the correct pipeline automatically, when you create your own configuration you need to pick the correct shader for the respective pipeline.

     
    Quote

     I'm not sure if that's going to require me to edit every prefab and move them down (-Y) or if Gaia has a way to adjust it.


    Officially the unity terrain trees snap to the terrain at the pivot point of the model, but there is a way to adjust this in the Gaia spawner:

    image.png
     
    Quote

     I also cannot seem to find what actually controls the visibility of the outer space skydome at night.


    That is directly controlled in the shader (PW_VFX_SkyDome.shader) depending on the direction of the sun. (Around Line 207 in the shader code)
     
    Quote

     wish that had been a built-in feature (should definitely be) where you can just switch moon textures.


    Unfortunately it isn't a built in feature for the older Procedural Worlds Sky. When using HDRP & unity 2021.2 and above we have a newer sky system that allows you to set sun & moon textures in Gaia. 

 

Link to comment
Share on other sites

Weird problems seem to continue. I'm beginning to wonder if upgrading "in place" hasn't just screwed a lot of things up that I'm now being forced to fix by hand, one by one ... some stuff just doesn't make any sense. I found the Y offset values for trees in the spawner, I even went in and adjusted each tree prefab, made the colliders perfect, slightly moved them, then uncheck "Snap to terrain" and gave them offsets of about -0.25 on the Y axis, respawned them ... everything looked fine, they were sunken into the terrain enough so as not to expose any gaps. I went around and looked at them and they all looked great. About an hour later, I realized my offset had been lost somehow and the gaps were back. It just moved my trees back above ground and screwed them up. I made sure the spawners were disabled and weren't being tampered with, and this happened multiple times. I thought I was going crazy at first until the behavior repeated itself. 🤔

 

And the battle with Flora continues. You are right about switching the materials, but that just makes nothing appear. They are invisible. I use the show debug spawn locations checkbox in the editor and confirm that Flora is trying to spawn those plant/grass prefabs from NM I have set up but they're simply invisible in the editor. And the same thing is even happening to some of the PW ones I've tried to use. I also have weird problems with materials getting whacky colors, glowing grasses and it's really, really hard and time-consuming. And no matter how I change the materials some grass just won't stop glowing ... I specifically select the one in the Flora config since it seems to make copies of things into a special folder and edit that, and I confirm that I'm editing the right materials by changing base colors around to identify them. But there's something eluding me that makes some grass glow bright white and green I still can't hunt down. I'll attach a couple of screenshots to show the current state of things if it will let me (forums hates my 4k screenshots and I have to rescale them all). The world looks pretty decent thus far, but the grass issues with Flora are really throwing things off and halting progress.

 

Thanks for the info about the outer space skydome shader, I think I can figure that out now. I realized the math to put that image in there is a bit complicated but I'll manage. But the more and more I'm going through with this the more I'm tempted to jump ship and move to HDRP ... 😑

Link to comment
Share on other sites

Realized I was saving screenshots as high quality PNG and scaling them and switching to JPG made them a lot smaller so the forums would accept them:

gaia_editor_01.jpg

gaia_editor_02.jpg

gaia_player_01.jpg

gaia_player_02.jpg

gaia_player_02b.jpg

Link to comment
Share on other sites

Swapped grass materials in the Flora setup panel to use the original ones from PW, but now I get weird dark grass that's totally screwed up and not reacting to lighting correctly. This stuff is getting really frustrating and difficult to diagnose. I may just need to take what I learned here and roll back to an older commit or just restart with a blank slate in an HDRP project.

 

I'd like to make a couple of suggestions here for improving Gaia and the workflow. For starters, project templates already setup for URP and HDRP would be invaluable to have. Having to import the whole entire thing (including everything for all 3 main pipelines), convert to the one you're targeting, fight with broken materials and pink error shaders, materials that don't look right when you change to the correct shader for some inexplicable reason, it's just a nightmare. Definitely need clean project templates where everything is set up correctly for each pipeline and such that it does not include materials and shaders for the unused ones. It's a killer on disk space both locally and in version control and it makes browsing your project structure and searching for things more complicated because 2/3rd of your materials are pink, incompatible ones just taking up space (and deleting them is easier said that done, because you can end up with a whole bunch of compilation/build errors). I know PW didn't invent this way of doing things, this seems to be a "common" way of doing things for all Unity assets and I think it's fundamentally bad, and we could make the whole Canopy PW toolchain better to work with by simply having good project templates and .unitypackages that import only what we need for our pipeline. You can continue distributing the entire payload as-is, but please make us some focused templates for each pipeline with minimal size and things already set up and free of errors. I'd literally be thrilled to have this, and it would make it easy to quickly create temporary projects to experiment with things or change projects as your experiments and prototyping evolves.

 

Secondly, some things like Flora are fundamentally difficult to work with due to the UI layout. The system of having little expanding dropdowns for each LOD in a Flora configuration to individually set each thing is extremely clunky and slow to work with. I would propose leaving that existing menu just how it is but adding a button to open a new "master tab" to see all LOD configs for Flora in another window or tab where they're organized in columns and rows. That way you can see things like LOD0, LOD1, LOD2 and so on side by side. I could easily configure things like fade in/out distances, change material properties and colors and tweak things to perfection intuitively and quickly, as opposed to expanding drop menus for each one, scrolling and hunting for this property or that one and easily getting lost and confused. Quite a few times now I've accidentally changed settings for one LOD level thinking it was another one because that part of the UI is just tough to work with. So I'd definitely like to see a separate tab or window with your Flora LOD configs in rows and columns, side by side, for easier editing. And it would also be nice if there could be an "All" column where I can set something like a Blend Color A and Blend Color B for a plant and have it apply to all LOD levels for that Flora object. This would be a huge time-saver and make it so much easier to work with.

 

That's enough for now, but I will have some more suggestions in the future the more I explore and work with these things. I forgot to ask: does Flora only support PW details shaders? Is that why my NatureManufacture objects I'm trying to use are invisible at runtime? I still haven't been able to figure that out yet. Some of my PW ones are also invisible as you can see in the screenshots above: they are there in the editor but then disappear at runtime, and no matter what I do I can't get Flora to draw the damn grasses and plants the way they look in the editor. My editor view of the terrain looks great, but at runtime my grasses and details look horrible no matter what I seem to do with the materials and shaders. That mismatch and loss of parity is very frustrating and makes iteration and progress hard, and I'd really like to figure out how we can solve that.

 

Thanks again for all the time and help,

 

Aaron

Link to comment
Share on other sites

Alright, to better illustrate/demonstrate the type of complications I'm having with Flora now, I recorded about 9mins of 4K video in Unity and flipped between editor and playmode at runtime, and also explored and tweaked some things in the inspector to highlight the issues I'm having. I've got some grass coming out with a weird alien-looking glow and most of my basic grass has weird dark patches in it and looks awful throughout the day/night cycle. I've tried re-assigning the original PW materials to the Flora configurations to no avail, and editing the materials doesn't seem have any effect on it at runtime because it seems that Flora keeps copying the materials over and over and over, each time I change something, then ends up working with crazy materials like "PW_SomeKindOfGrass_01_34934099_0340239_39349.mat" and it becomes impossible to tell what's going on, make adjustments or debug things ... and as I mentioned earlier, those Flora inspector menus and drop-down sections are really cumbersome and unwieldy. Anyway, take a look at the video and see if anyone is able to make sense of what's going on here:

 

(NOTE: Several grass and plant types that should be showing up in this video are simply invisible at runtime ... I can see their spawn locations showing up as expected, but there's no actual visuals showing up where it belongs. This applies to both NatureManufacture assets I tried to integrate into Flora as well as some of the included PW grass/plant details that came with Gaia Pro)

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

 

Problems with Gaia Pro 2021 & Flora with Grass & Details (YouTube Video)

 

 

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

 

And I'm sure I've been driving you guys insane with my posts, but I truly appreciate the dedicated support and all of your time and care! That's why I maintain that Pro subscription even when I'm not using Gaia/PW for anything at the moment because I want to support the growth and evolution of these tools!

 

Thanks again for everything and let me know what you think I should do,

 

~Aaron C.~

Link to comment
Share on other sites

Hi @atcarter714,

 

sorry for the delayed reply, I had to look deeper into some of these issues and I reviewed your video as well inbetween. I think I have some replies that should help you with your issues:
 

On 8/24/2022 at 5:36 AM, atcarter714 said:

. About an hour later, I realized my offset had been lost somehow and the gaps were back. It just moved my trees back above ground and screwed them up.

 

I looked into this and I think I found the cause for this: Unity itself does always snap the trees to the ground when you apply them to the terrain with the terrain inspector, there is normally no way to influence the tree y-position in vanilla Unity. Gaia works around this via the unity API where you can pass in a y-coordinate for the tree instance. I found that when the terrain heights are changed again after the trees are spawned, unity seems to re-fresh the tree positions on the terrain and snaps everything to the terrain again. We might be able to add something to Gaia to re-apply the height offset in a future update, but for now I would recommend to adjust the pivot of the tree model, or re-spawning the biome after terrain changes.

 

16 hours ago, atcarter714 said:

I'd like to make a couple of suggestions here for improving Gaia and the workflow. For starters, project templates already setup for URP and HDRP would be invaluable to have.

 

This is a good suggestion in general, but there are some technical hurdles that would greatly increase the effort involved when publishing a new build for Gaia. Did you go through the pipeline setup process in the Gaia Manager?

image.png

Because after the pipeline switch has finished, everything should work correctly in the target pipeline and there should be no pink materials or such. An exception might be the custom-made flora configuration because there is no check in place for the shader on the material for custom materials, but other than that the result of the pipeline setup process should be as if you had a template installed that is designated for the respective pipeline.
 

Regarding the Flora issues:
 

- Generally speaking it is correct that the grass that you see in the editor is different than the one that you see during runtime. Flora uses the default unity terrain details as a "crutch" to know where to draw the vegetation. Most of the gaia spawners just use flat textures in the default unity terrain detail system, and those are then replaced with a 3D model & the flora shaders during runtime. We know this can be confusing, we are working on getting the Flora rendering working in the Editor & using our own positional data so we do not need to rely on the terrain detail system anymore.
 

- It looks like when selecting the materials independently of the Flora settings object, it does not refresh correctly during runtime. What you can do to avoid this is: While looking at the Flora child objects on the terrain to tweak the settings, unfold the section with the shader settings here:

image.png

If you make changes on the shader / material here during runtime, it will apply them instantly, and they will persist after stopping the scene as well.
 

- With the material editing method mentioned above, can you please check the material settings for the glowing vegetation? Especially the two settings for "_Ambient" and "_BaseColor" (intensity needs to be set to "0" for the color), those two would have the potential to make the vegetation so bright it shines at night.

 

image.png


-The darker patches of the grass should be intentional, for every Flora item you can define two colors to tint them in so that there is some slight variation in color which appears more natural. I think with the dark patches shown in your video the colors might be too different, here is an example in pictures:

image.png

image.png

 

13 hours ago, atcarter714 said:

That's why I maintain that Pro subscription even when I'm not using Gaia/PW for anything at the moment because I want to support the growth and evolution of these tools!


Thanks for sticking with us through this process, Flora is a difficult corner of Gaia because it is not as evolved yet as we want it to be. We often get scolded over miniscule details and sometimes even over things we have no influence about (e.g. issues with the unity package manager), so it is highly appreciated to see it being the other way around here!


 

image.png

Link to comment
Share on other sites

I'm running through this stuff step by step to make sure I've got everything matching your configuration. And yes, I installed URP packages/materials right off the bat. I think I had to do it again when I upgraded over the top of the older Gaia version, which is right about the time the problems began. I noticed Fields of Color and a lot of content had somehow become broken and I had to manually convert or edit stuff, and that's when it all became a big, broken mess. And good info to know about Unity repositioning trees of its own accord: that sounds exactly like what happened here, and I bet you're right.

 

Looks like I found the problem with this crazy lighting. The wrong textures were assigned to normal and mask, so it was making lighting calculate in some extreme, crazy ways. The ones that seem to work have names containing "billboard" and an "N" for "normal" or "M" for "mask". For some reason, converting to HDRP didn't seem to properly convert/swap everything. Some still had built-in shaders assigned that I had to switch to the URP shader but the material properties were wrong, and some stuff got broken through the course of furiously fighting with it and doing only the gods know what, lol. So I think I've basically got the bad lighting on the working grass prefabs fixed.

 

The question still remains though: why do some PW Flora configurations simply not appear at runtime (invisible, despite Flora showing debug locations where they should be) as well as any custom or 3rd party ones I set up? If I drag and drop them in the scene there's nothing wrong with them, but at runtime they spawn and there's just nothing there ...

Link to comment
Share on other sites

14 hours ago, atcarter714 said:

I think I had to do it again when I upgraded over the top of the older Gaia version,


Yes, the package manager in unity overwrites existing files, which e.g. changes the materials back to the built-in pipeline. Gaia should offer the button for the shader installation in the Gaia Manager again in this case.

 

15 hours ago, atcarter714 said:

The question still remains though: why do some PW Flora configurations simply not appear at runtime (invisible, despite Flora showing debug locations where they should be) as well as any custom or 3rd party ones I set up?


Hmm, normally I would say if an item does not appear at the debug locations, it is either using the wrong shader, or it has no textures assigned, or it is rendered very small or with an offset in the model maybe. Do you have an example of a PW asset that is configured to work with Flora and does not appear?
You mentioned that you are trying to set up the nature manufacture assets from the advanced foliage pack with Flora - I will try to get that pack to provide you with some example configurations for comparison.

Link to comment
Share on other sites

12 minutes ago, Peter said:


Yes, the package manager in unity overwrites existing files, which e.g. changes the materials back to the built-in pipeline. Gaia should offer the button for the shader installation in the Gaia Manager again in this case.

 


Hmm, normally I would say if an item does not appear at the debug locations, it is either using the wrong shader, or it has no textures assigned, or it is rendered very small or with an offset in the model maybe. Do you have an example of a PW asset that is configured to work with Flora and does not appear?
You mentioned that you are trying to set up the nature manufacture assets from the advanced foliage pack with Flora - I will try to get that pack to provide you with some example configurations for comparison.

 

Now that would be truly awesome. I haven't really been certain about what the "proper" way of using NM or other 3rd party assets with Gaia's systems is, and I've been plagued with problems. Unity won't let you add a NM plant prefab as a detail if it has LODs on it. I've continued trying to use the meshes to configure LODs for Flora, but I've concluded that there's something about the material/shader that renders it invisible at runtime when spawned by Flora. I say this because I know for a fact that the mesh is there, I can actually see it for a split second if I do something to force Unity to reload shaders and make it turn baby blue before it disappears. I also slapped a random shader on it just to play with the depth buffer and see if I could make it appear and I created some weird, blurry areas the exact shape of the underlying grass object meshes and could tell they are indeed present (I know that's a very silly method, but there's just too much geometry in the scene to see it in wireframe lol).

 

I've got the basic PW grass patches looking quite good now and made some significant visual improvements to everything, even the post-processing. And things are really looking good for the basic things I've put in there so far. I just don't know how to make my Nature Manufacture packs behave with Flora and show up, and it's really bumming me out ... 😥

Link to comment
Share on other sites

Here's some screenshots of the situation with the one NM grass prefab I've been trying to use with Flora that insists on remaining invisible. Unfortunately, the forums only accept really small resolution images so you probably cannot see the debug spawn location lines showing the places on the ground the grass is supposed to be, but they are there.

 

NM_Grass_Issue.jpg

NM_Grass_Issue_02.jpg

NM_Grass_Issue_06.jpg

NM_Grass_Issue_04.jpg

NM_Grass_Issue_03.jpg

NM_Grass_Issue_05b.jpg

Link to comment
Share on other sites

Hi @atcarter714 I went and installed the advanced foliage pack to make an example setup. Please find attached an .unitypackage, you can install it via Assets > Import Package > Custom Package. It will add this spawner in the project hierarchy:

image.png

 

You can add this spawner to a scene where you spawned the alpine meadow biome by selecting it and click the "Add To Scene" button, or by adding this spawner to be part of the biome setup in the world designer.

It contains one rule to spawn the grass item from your screenshot. You should get the following result:

image.png

You can download the file here: NM Grass Example.unitypackage or from the attachements.

Looking at your screenshots I think I might have found the issue in your setup: You seem to use the original material from the nature manufacture asset which still uses a NM shader as well - this will not work as those shaders will not work with instanced indirect rendering of flora. You need to use the Flora shader for the right pipeline, and only use the available textures from NM. Hope with the example setup you will be able to solve this issue for good.

  • Like 1
Link to comment
Share on other sites

11 hours ago, Peter said:

Hi @atcarter714 I went and installed the advanced foliage pack to make an example setup. Please find attached an .unitypackage, you can install it via Assets > Import Package > Custom Package. It will add this spawner in the project hierarchy:

image.png

 

You can add this spawner to a scene where you spawned the alpine meadow biome by selecting it and click the "Add To Scene" button, or by adding this spawner to be part of the biome setup in the world designer.

It contains one rule to spawn the grass item from your screenshot. You should get the following result:

image.png

You can download the file here: NM Grass Example.unitypackage or from the attachements.

Looking at your screenshots I think I might have found the issue in your setup: You seem to use the original material from the nature manufacture asset which still uses a NM shader as well - this will not work as those shaders will not work with instanced indirect rendering of flora. You need to use the Flora shader for the right pipeline, and only use the available textures from NM. Hope with the example setup you will be able to solve this issue for good.

 

Thanks @Peter for the assistance, answers and the example files! I'm going to try those out in just a moment. Had a long day crammed with meetings today so this is the first time I've had a chance to settle in and give it a go. But your answer confirmed my suspicion that the shader/material was the reason it wasn't working, after exhausting every other possibility. I'm sure that it will work now that I know this and will have to change it to the Flora version.

 

That brings another interesting question to mind for me: what would it take to use a custom shader with Flora? Does it just need to implement the correct properties and operations to work with Flora? Or is it for some reason technically impossible to use another shader with it without rewriting the way Flora works? I would guess that it just needs to match the "signature" of the shader and provide the same things to work with it, no?

Link to comment
Share on other sites

9 hours ago, atcarter714 said:

That brings another interesting question to mind for me: what would it take to use a custom shader with Flora? Does it just need to implement the correct properties and operations to work with Flora? Or is it for some reason technically impossible to use another shader with it without rewriting the way Flora works? I would guess that it just needs to match the "signature" of the shader and provide the same things to work with it, no?


I know that it requires adaptions in the shader to work with it, paging @Isaac for a more detailed explanation.

  • Like 1
Link to comment
Share on other sites

2 hours ago, Peter said:


I know that it requires adaptions in the shader to work with it, paging @Isaac for a more detailed explanation.

 

That would be great, and things are starting to look a lot better now! I've been able to take these answers to fix the major problems I was having (which were mainly, admittedly, caused by me not knowing how PW tools worked or how to use them initially) and I've been figuring out how everything works. I still have a handful of smaller issues to work out, but it's great to have those major ones resolved (for the most part) and to see the scene looking way better and closer to how I intended at this stage. I'd definitely love to find out what Issac can tell me about some of the shaders and how I should approach customization like creating new foliage/detail shaders or modding the existing ones.


You can see a smaller shading/lighting issue I'm having with foliage in the pic I've attached: it's not really bad, but the grass has highlights in it that are just a bit too unnaturally bright for the level of lighting in the scene and it's throwing things off. And I'm concerned that simply playing the _MaskMapMod values, which gets rid of it, might have unforeseen consequences for other lighting conditions and make the grass too dark during more brightly lit conditions. This is similar to the "glowing grass" problem I had after upgrading to the latest Gaia version and re-converting to URP when it reassigned the normal and mask maps to grass intended for the built-in pipeline, but that's no longer the case and the correct maps are assigned to the materials, so it has to be something else here. So hopefully you can advise me on what key properties and settings I should pay attention to in order to make things look correct in all types of lighting and simulated weather conditions. No doubt I messed something up trying to figure out and fix previous issues I've had.

 

Getting the night/day cycle, lighting and weather to look right is going to be the next big thing I need to work out so the scene will look good and appear as I intend during all hours of the day and weather conditions. So I'd definitely like to read any available articles and documentation about the way time of day in URP works, the lighting and weather system, etc. And I'll be revisiting things like implementing a high quality moon texture and adding a more substantial sun and flares. I already modded the skydome shader for the night sky to draw a white circle precisely where the moon belongs, but haven't quite figured out how to map my texture into it yet. I asked Freya Holmer for some advice on it and she said I was going to have to use some angular coordinates and do some fancy UV math like atan2 to map the texture pixels into the circle correctly, so I guess that's another rabbit hole I'll be heading down soon, haha. It actually might work a lot better to just use a plane/billboard for the moon with a custom shader and play with the depth so it always stays behind the scenery and clouds but on top of the night skydome. It would just have to be locked to the active camera position always and set to a proper distance and scale, and just move around as the moon directional light rotates (which appeared to just be -SunDirection (negative sun direction), which sort of works but isn't truly correct). And I'd still have to figure out the math to make it appear at a defined angular size: the real moon appears at an angular size of approx. ~0.52 degrees in the night sky on Earth, so that will be a whole lot of fun to figure out, LOL

 

Grass_glowInRain_01.jpg

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