Search Unity

[RELEASED] GPU Instancer

Discussion in 'Assets and Asset Store' started by LouskRad, May 3, 2018.

  1. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    I´ll just leave this here. After many years I think I´ve finally found the right setup and tech for my generated sailing / exploration / city building game. Using MapMagic and GPUI



    More shots and zoom out video: https://imgur.com/a/GRTnbiI
     
    LouskRad, ftejada and blacksun666 like this.
  2. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    Hey,

    Despite the rather steep learning curve and a couple of bugs when targeting Android, I'm quite happy with the overall x2 performance gain over the built-in material GPU Instancing. But there are some issues I can't get my head around.

    It's almost impossible/useless to get occlusion working with my scene setup, and it was one of the key reasons for buying this asset. It looks pretty much like the depth texture precision problem and I know it's mentioned in the FAQ, but quite vague w/o any details and workarounds.

    I might be missing something as my depth textures are mostly black, it takes the camera to get *really* close to any object to start getting anything on the depth texture. And this is platform-independent. In the demo scenes depth buffer is much more vivid and covers more, though it still does not guarantee very precise culling.

    Hardware depth buffer supposed to be 16/24 bit, but HiZ script shows depth texture in R channel only, assuming 8 bit. Is it just for the debug and the original precision stays the same under the hood? And given that I know the exact bounds of my scene, is it possible to remap the [0,1] depth from [camera origin, infinity] to smth like [Zlow, Zhigh] ? I can imagine a custom depth pass to do it, but then it'll require same tweak in the GPUI compute shaders.


    Also, there is substantial flickering on Mali T880 GPU. It seems to be Mali drivers issue, not a GPUI problem, but just in case I'm not the first one to bump into it. The similar thread is here: https://community.khronos.org/t/flashes-on-arm-mali/76854 And the solution to flickering that guy game up with is "split the SSBO into two parts". Also to note that turning on "debugger enabled" in the HiZ script gets rid of flickering (and half of fps as well :).
     
  3. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    Can't figure this out. The prefab is on the left, I have it in the detail manager and when I paint the details on the terrain they come out yellow and red. I'm using the GPUI URP Foliage shader, and I don't have red as a color anywhere - not on the detail editor or on the shader (or in the texture)
     

    Attached Files:

  4. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @LouskRad !! Tropical Forest Pack asset are compatible with GPU Instancer??
    The developer of the TFP asset told me that he contacted you and you were reviewing the Shaders or something.
    Can you tell me how it goes? I work in HDRP

    Cheers
     
  5. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Another question @LouskRad ! I don't know if what I'm going to ask makes sense or is nonsense. Excuse me if so
    I have models that have several Lods, that is, a prefab that contains a parent GameObject (with LodsGroup Component) and also contains the child gameobjets (not nested prefabs), each with its different meshes of lower tris according to the Lod they represent .

    What is the most optimal way to work this would be to break the prefab and redo it again, making a prefab for each gameobject of different polygon and dragging each of these prefabs to the GPU Instancer or instead of dragging the remade parent prefab (the one has the LodsGroup component), and what contains all the new nested model prefabs?
    I'm reading the documentation and it seems to indicate this ...

    Cheers
     
  6. twangydave

    twangydave

    Joined:
    Mar 30, 2017
    Posts:
    41
    Hi there,

    I've got a particularly busy scene that needs some FPS help and I think this could do the job, and it is on sale. My issue is I'm working in 5.5.2, and I see the minimum required version is 5.6.5 or higher.

    I'm not able to update to 5.6.5 but I wondered if there anything in this which will prevent it importing into 5.5.2?

    Would I be able to give it a go and get a refund if it didn't work?

    Cheers!
     
  7. Rokugan90

    Rokugan90

    Joined:
    Aug 20, 2013
    Posts:
    3
    Hey guys, I just got GPU Instancer but I'm noticing something weird. I can basically see grass popping in while I walk, I thought the problem was my scene but I tried in the demo scene and it does the same. Here's a gif: https://gyazo.com/a3ea3280a417d659745c10006dd5216f version is 2019.3.0f6
     
  8. DragonTein

    DragonTein

    Joined:
    Jul 1, 2018
    Posts:
    15
    Am i correct assuming that i dont need tree manager if i use standart mesh prefabs as trees in unity terrain, and GPUI Prefab Manager manages them?


    i cant seem to figure out how to make tree manager to work - it detects trees in unity terrain correctly, they show up in editor, but when i start game they all gone
     
    Last edited: Apr 17, 2020
  9. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,

    GPUI is only using the depth texture that Unity Generates for the camera. This texture's precision is thus limited to what Unity provides as the depth texture in the given render pipeline. GPUI's occlusion culling system is based on this texture, and thus also carries its limitations over. This also means that the remapping question is not related to GPUI (since GPUI does not itself create the depth texture but uses what is provided by Unity).

    You are right that the debugger overlay shows only a representation of this texture, using only a red channel for the purpose.
     
  10. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Please take a look at this wiki article on the subject.

    GPUI auto detects LOD Groups and handles each renderer (creating a seperate draw call for each renderer materials) automatically. For the common usage, all you need to do is to have the LOD Group component in the parent object and add this to the manager.
     
  11. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    Unfortunately, 5.6.5 is the bare minimum GPUI can officially support.
     
  12. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    For texture type terrain details, GPUI (optionally) uses a cross quad mesh for the close up level of detail and a single quad for lower detail in a distance. What you see in the gif is the single quad billboard mesh switching to a cross quad. You can increase the distance in which this happens (or disable it completely) from the Detail Manager's Cross Quads section.
     
  13. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    The Tree Manager adds the prefabs that are defined on a Unity Terrain automatically and renders them, whereas the Prefab Manager can be used for tree (or any other) prefab instances in the scene (not defined as a tree prototype on a Unity terrain).

    However, both managers will use the same rendering system to render the prefab instances, and the reason why the trees do not show might be a camera or a custom shader issue.

    For the camera, please make sure the camera is tagged as "Main Camera" or manually define your camera to the manager.

    If there is a custom shader issue, you might need to setup the shader manually for GPUI. You can find more information on this related wiki article.
     
  14. twangydave

    twangydave

    Joined:
    Mar 30, 2017
    Posts:
    41
    Thanks for the info - I will look at the logistics of updating.
     
  15. DragonTein

    DragonTein

    Joined:
    Jul 1, 2018
    Posts:
    15
    done everything, but still...
    Should i send debug files or something?
     
  16. chris_schubert

    chris_schubert

    Joined:
    Jan 8, 2019
    Posts:
    28
    Does GPUI support light probe proxy volumes? Or any other way to avoid having uniform lighting across instances in Realtime GI?

    If not, would you mind explaining why? I see the code block applying the enable/disable light probe switch and it seems like it would be simple to tell it to use volumes or even custom probe data. I'm also confused why all instances share a light probe when the Unity docs say that is not the case.

    The DrawMeshInstancedIndirect method seems to support it ( https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstancedIndirect.html ) & ( https://docs.unity3d.com/Manual/GPUInstancing.html ).

    Specifically this section:

    GPU Instancing supports Global Illumination (GI) rendering in Unity. Each GPU instance can support GI coming from either different Light Probes, one lightmap (but multiple atlas regions in that lightmap), or one Light Probe Proxy Volume component (baked for the space volume containing all the instances). Standard shaders and surface shaders come with this support enabled.

    EDIT:
    So I implemented this myself, and found the following:

    Even though the DrawMeshInstancedIndirect method takes light probe usage mode/proxy volume, it doesn't use them at all. As far as I can tell, it doesn't care what usage mode you give it - it always samples a single probe (and I can't tell how/if you can control which probe). I tried using the 'Custom Provided' method as well, directly passing in the spherical harmonics data but the editor barked at me for trying to assign more than 1023 elements via the Material Property Block.

    The new-ish DrawMeshInstancedProcedural method mentions that it is similar to DrawMeshInstancedIndirect, but also explicitly mentions the ability to provide custom lighting info via the Material Property Block. I'm sure it won't work, but I'm going to install the 2019.3 version and test it.

    This is all pretty disappointing because of the drop in lighting quality as soon as you pass 1023 instances:
    INSTANCED_VS_INDIRECT.png

    Any ideas would be appreciated. At this point I'm wondering if it isn't a bad idea to pass the spherical harmonics data into the shader via a compute buffer (instead of the MPB array they provide) and extend the procedural setup method to try to apply the data there.
     
    Last edited: Apr 24, 2020
  17. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Please send us a support request following this guideline so we can identify the issue.
     
  18. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    As you have mentioned, Unity does not actually implement this (even though the documentation hints that it does). A custom implementation is indeed possible. The implementation would be rather complex (especially considering how you will pass the SH data in a buffer for variation). Even if you pass this data, you have to edit the whole unity includes since they are disabling light probe usage, so you would be better off with writing the lighting base yourself.

    In short, this would basically result in re-implementing most of the Unity light probe implementation, but it is indeed possible.
     
    chris_schubert likes this.
  19. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    I am having the same issue with terrain trees not showing in Unity 2019.3.10f1 and HDRP 7.3.1 - GPUInstancer works find with the same tree when it's added as a prefab in the Prefab Manager, so it's not a shader issue. Using the same tree through GPUIntancer Tree Manager just simply won't work.

    Tree's are from Nature Manufacture Meadow pack.

    Again, working perfectly fine in the Prefab Manager but won't work through Tree Manager. I've tried all the settings and even editing the materials, nothing works. Is there any fix?
     
  20. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    *NOTE*

    Doing some testing and checking things, I noticed that GPUI Tree Manager automatically sets Unity Terrain settings Tree Distance to 0 when it is initialized in play mode.
     
  21. chris_schubert

    chris_schubert

    Joined:
    Jan 8, 2019
    Posts:
    28
    Thanks, I'm taking a crack at this now. Something that may interest you: while the standard shader isn't using light probes, light volumes, or custom provided light data with either DMInstancedIndirect or DMInstancedProcedural, I still actually get correct lighting data (using both DMII and DMIP), even rendering more than 1023, if I use a custom lighting model. I'm trying to narrow down now where the issue is but it might not be that bad.

    Here's 10K cubes, rendering with DrawMeshInstancedProcedural, indirectly lit with realtime precomputed GI (planes are lightmapped).
    instanced_indirect_lppv_customlighting.png

    I'm specifying a light probe proxy volume directly in the draw call. Responds immediately to a change in the green plane's emission color:

    instanced_indirect_lppv_customlighting_2.png

    I'm getting the diffuse color for the cubes above from UnityGI_Base, so something is working. Specular info looks fine too, as does light attenuation. Shadowcasting/receiving are working. It might not require that much re-work - it seems like I will not need to touch anything with light probes at all.
     
    Last edited: Apr 24, 2020
    tcz8 and LouskRad like this.
  22. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    I'm also finding this. If I turn up the tree distance to even 0.1 all the trees show.
     
  23. D1234567890

    D1234567890

    Joined:
    Aug 11, 2019
    Posts:
    65
    I tried using this with the following grass asset in their demo scene. I used prefab mode and registered their prefab in the manager. The generated shader prefixed all of their local paths with the URP package path. It was easy enough to fix manually. Let me know if you need any more information.

    • GPU Instancer 1.4.0
    • Unity 2019.3.9f1
    • URP 7.3.1
    • MacOS and Windows
     
  24. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    Works fine if you disable 'initialize in coroutine'
     
  25. chris_schubert

    chris_schubert

    Joined:
    Jan 8, 2019
    Posts:
    28
    Just for posterity, because I have not seen anywhere saying that it is possible to get non-uniform lighting when using instanced indirect rendering like this: I was able to get instanced indirect/procedural rendering working via the Graphics.Draw* calls, and it seems to be taking into account the different lighting options. This is 2019.3.10f1. Here's a comparison of the Light Probe Usage options for 10K cubes rendered with 1 call, taking advantage of realtime GI emissive surfaces, reflections and shadowing:
    10K_CUBES_INSTANCEDINDIRECT_LIGHTCOMP.png
     
    Last edited: Apr 24, 2020
    tcz8 likes this.
  26. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    not for me
     
  27. mlaibow

    mlaibow

    Joined:
    Feb 5, 2014
    Posts:
    40
    Has anyone added the variation buffer (as in the ColorVariation demo) to the Standard Shader?
    There is a GPUI version of the Standard Shader in the GPUI asset package, but it uses the cgincs from the standard shader directly from the engine. I think the buffer code has to be added to the specific renderer (such as forward) code which is in those includes.

    The ColorVariation shader is too basic a shader to use. I am looking to instance a prefab that uses the Standard shader and I would like to have the emissive color vary for some of the prefabs. This seems like a fairly standard use case of the variation feature.

    Thanks,
    -mat
     
  28. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    So I've managed to fix the Occlusion gap, it's a bug in the GPUInstancerCameraData

    Unity_DOGoauIELF.jpg

    Unity_rt9g6Wklk7.jpg

    GPUInstancerCameraData.cs : 36

    Code (CSharp):
    1. bool d3d = SystemInfo.graphicsDeviceVersion.IndexOf("Direct3D") > -1;
    2.  
    3. Matrix4x4 P = mainCamera.projectionMatrix;
    4.  
    5. if (d3d)
    6. {
    7.   for (int i = 0; i < 4; i++)
    8.   {
    9.     P[2, i] = P[2, i] * 0.5f + P[3, i] * 0.5f;
    10.   }
    11. }
    12.  
    13. Matrix4x4 mvpMatrix =
    14.   (hasOcclusionGenerator && hiZOcclusionGenerator.isVREnabled
    15.   ? mainCamera.GetStereoProjectionMatrix(Camera.StereoscopicEye.Left) : P)
    16.   * mainCamera.worldToCameraMatrix;
     
    LouskRad likes this.
  29. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey there,
    So... I love the performance I get when using GPUI, but I´m absolute desperate when it comes to the detail manager !
    I just don´t understand what´s going in when I try to tweak the size or the color of grasses in my project.

    I never get my grass texture to look as it is supposed to be (namely, look like the bitmap used).
    In the example below, I even set the colors to pure black in the foilage shader properties. Please note also the size: It´s much wider then high.
    As soon as I hit play or simulate on scene camera, the below picture is the result. It´s obvious that is has nothing to do with my input. The sizes are off and obviously the colors too.
    For the better part of 2days now I tried everything, different textures, different colors... I give up !



    So, please explain someone to me what´s going on. I simply want to see my input grass blade texture (which is green). Is there a way to just ignore all color and wind sway features ? I just need a much higher view range and better performance.

    Oh and since I´m here :) , It´s also it´s a pain to enter the values for all trees and details on a multiterrain setup everytime something changes because there is no way to save it presets / values.

    Thank you !
     
  30. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    57
    Hi,
    Since John Conway sadly passed away this week, i have been looking to implement his Game of Life, as such been looking for a way to render a vast amount of quads in either black or white. Thought perhaps GPUI might be usful for this but i haven't been able to utilize it in the correct manner yet.

    Most successfull apporach so far is by using texture.SetPixels to a texture, getting about 4ms with this approach.
    I tried holding ref to quads <Renderer> in a single 2d array and changing the matieral on them, 23ms
    I then tried having both white quads and black quads both in cell pos and we change which is enabled, 33ms
    I then tried having both white quads and black quads both in cell pos and we change which is transform is on top, 50ms

    So everything i tried so far is just way slower then SetPixels, so i wondered if i could utilize GPUI, bit rusty with the Asset but i thought that perhaps ColorVariations.cs or PrefabsWithoutGameObjects.cs woudl be a good start.

    GPUInstancerAPI.UpdateVariation() seemed like a option, but am i correct that i can only update the colour of 1 prefab instance per call, if so its to slow as an option.

    Any suggetions on a fast method that may work faster then SetPixels? Perhaps having a matrix4x4Array for a pool of whites and another for a pool of blacks and update the matrix4x4Array for each to create final 2d array of quads?
     
  31. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    Vanilla Unity project (Standard RP, 2019.3.11f)

    I've imported and used HQ Photographic Textures Grass Pack Vol1 and a grass texture (.psd) from there.
    I've painted very densely on terrain.

    With Unity default, I get some decent FPS.
    without GPUI 2020-04-25 022650.png

    However, when I use GPUI, though I get a highly better rendering, I get an impossible FPS.
    with GPUI 2020-04-25 022702.png

    Everything is at default, only thing I did is to set Unity settings to use .Net 4.x instead of 2.0
    Obviously I am doing something very, very wrong.
     
  32. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    It's probably more dense in GPUI. Check the settings to see if quads/etc are enabled.
     
  33. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    Quads and shadows are disabled, I removed detail instance manager and re-added it, with default settings. Still same result.
     
  34. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    You can try these API calls:
    DefineAndAddVariationFromArray<T>
    UpdateVariationFromArray<T>

    I've just put them right after the corresponding Matrix4x4Array calls.
     
  35. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    If the trees work in the Prefab Manager, they should indeed be working with the Tree Manager as well - unless there is something in your project that might be making modifications on your terrain trees before GPUI starts.

    In any case, you can email us a sample project showing this so we can investigate the cause of the issue.
     
  36. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    GPUI Tree Manager works by turning the Tree Distance on the terrain off to 0 and rendering the trees itself instead. So it is normal that you see the Tree Distance at 0 on the terrain. If you increase this, the result you see is not rendered by GPUI but with Unity.
     
  37. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Thank you for the feedback.
    We have identified the cause of this issue and we will fix it in the next update.
     
    D1234567890 likes this.
  38. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Yes, if you wish to add the variation buffer to the Standard Shader, you would need to add the buffer code to the pass(es) that you will be using in the shader (e.g. if forward, forward base and forward add passes, and if deferred, the deferred pass). If you wish to override the cgincs, you can download the them from the Unity Archives (and add them to your project to edit them).
     
  39. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Thank you for the feedback. We will investigate this and update the occlusion culling code accordingly.
     
    ftejada likes this.
  40. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,

    The default foliage shader that GPUI uses is based on the Standard Lighting Model (as opposed to the Lambert that Unity uses on the terrain details in the Standard Pipeline). If tweaking the Foliage Shader Properties is not working out for you, you can use the Lambert version of the Foliage shader in the project instead (or any other material with a third party shader).

    If you are using the Standard Pipeline and if you wish to use the Lambert version of the Foliage Shader for all your details, you can create a custom material with the GPUInstancer/FoliageLambert shader for each of your texture type detail prototypes and use it as a custom material in the Detail Manager for the corresponding prototypes.

    As for the map magic value resets upon re-import, we will look into what we can do about this.
     
    secondsight_ likes this.
  41. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Any suggetions on a fast method that may work faster then SetPixels?
    Using a RenderTexture and updating the pixel colors (using the texture as a RWTexture2D) on a compute shader would be faster than using SetPixels.

    I believe using GPUI for rendering pixel quads would not be a more ideal option than using a RenderTexture for this.
     
  42. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    For balancing between visual quality and performance when using the Detail Manager, please take a look at this Best Practices wiki.
     
    TanselAltinel likes this.
  43. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @LouskRad
    hi,
    does GPUI shadergraph node working with shadergraph 9.x ?

    or is it possible to implement GPUI instancing feature by using shadergraph's custom function node?
     
    Last edited: Apr 27, 2020
  44. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15

    Tested with very basic trees using HDRP Lit shader and Unity 2019.3.10f1 - Everything else is vanilla. Please just try GPU Instancer with HDRP and Unity 2019.3.10f1 to see results. Thank you.
     
  45. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    hi I just brought GPU instancing and saw all the tutorial videos, a really powerful tool. So when I try to use the Tree Manager but I get the problem
    - the trees are not visible after clicking play button. In the scene the trees are still visible.
    pls note I use 2019.2.1 version and 6.9.1 HDRP
    Also this is a Gaia generated terrain with the tress generated using the biomes in Gaia, also basically the terrain still remains as a Unity terrain with Trees as prefabs in the paints trees option of the Unity terrain.
    Pls see the screenshots.
     

    Attached Files:

    • GPU1.jpg
      GPU1.jpg
      File size:
      147.6 KB
      Views:
      371
    • GPU2.jpg
      GPU2.jpg
      File size:
      124.2 KB
      Views:
      361
    Last edited: Apr 29, 2020
  46. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @LouskRad !!!

    I have a very rare error and I don't know how to fix it. Unity version 2019.3.7f1 y HDRP 7.3.1 Dragging some prefabs GPUI Detail Manager starts throwing console errors of type null references ...
    I have looked at those prefabs that cause the crash and apparently they are similar to other prefabs that don't give the problem (same shaders, Lods, etc)
    How can i fix this? what am I doing wrong?
    (It may also happen with the other GPUI Managers but I didn't test it). I leave video:


    Since this problem occurred the first time, every time I play Unity GPUI it takes a long time to load the terrain details prefabs in the scene. Before it did not happen and it was very fast. I leave video for you to see:


    I have tried to restart Unity, also to erase GPUI and import it again but the problem was not solved ....

    Can you help me solve these two problems?

    Cheers

    Edit: Hi!!!
    For some reason the delay problem to show the details of the Terrain on the scene when giving the play, has solved itself ... I do not know what caused it or why it has been solved ...
    The only thing I have done has been to continue painting the terrain with other vegetation prefabs ...

    What I still have is the problem that some prefabs cause the GPUI Detail Manager to pull null when dragged ...
     
    Last edited: Apr 27, 2020
  47. MinoanStudios

    MinoanStudios

    Joined:
    Dec 10, 2017
    Posts:
    11
    Hey @LouskRad!
    Thanks for a fantastic asset, I'm sure I'll be super happy when I get it fully working! I have two questions:

    1. I'm trying to do color variations on trees using the prefab manager. The shader is a URP shader graph that I've copied over and instancing works flawlessly with both auto and manual adding/removing of instances, however when I adjust the shader code as per the documentation (for color variation) I get this error: "undeclared identifier 'gpuiTransformationMatrix'". I am pretty confident that I have set up buffers and everything correctly and I have tried with both of these lines added:
    #include "Assets/GPUInstancer/Shaders/Include/GPUInstancerInclude.cginc"
    #pragma instancing_options procedural:setupGPUI
    I have also tried the following from the color variation demo that differs a bit from the documentation and get a similar error with gpui_InstanceID:
    o.colorVariation = colorBuffer[gpui_InstanceID];
    Do you know why I get this error? Would be great if you could provide the same example of the color variations but with shader graph generated code as it differs quite a lot from the current example code and doc.

    2. I'm currently switching from a regular tree model to a dead tree model during winter and then back, both of which are instanced with GPUI. I'm doing it by calling Enable/DisableInstancing() and then just enabling/disabling the gameObject. Is there a more preferred way of hiding an instance like this? Can I just choose to not render or cull any specific instance?

    Cheers
     
  48. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    Yes, it seems many people are having this issue but the developers have not properly addressed it yet.
     
    ash4640 likes this.
  49. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    Figured out the source of the bug for the Tree Manager not showing trees. It has directly to do with "LOD Cross Fade" in the LOD section. If you disable LOD Cross Fade the Tree Manager works as it should. This is a bug that I hope the devs address asap.
     
  50. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    I tried gpu instancer today and all my trees/grass looks extremely different (except the naturemanufacture trees - those look the same).

    I am mostly using the trees/grass from Flooded Grounds. Most of the grass has turned dark and colorless, and the trees have become much brighter green and less lush.

    What is going on? Are the flooded grounds shaders just not supported?

    The trees are using hidden/nature/tree creator foo bar optimized shaders
    The grass seems to be using the standard shader?

    I can't believe you can't upload images to a game engine forum
     
    Last edited: Apr 29, 2020