Search Unity

[RELEASED] GPU Instancer

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

  1. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    The Tree Manager does not have add/remove functionality for the tree instances, however, you can use the Prefab Manager to have such control over your instances.


    Thanks!

    All GPUI's culling features work in the GPU and only on the GPU instanced objects by GPUI, so unfortunately it is not possible to use them on other objects. There are other solutions in the asset store for this purpose, but I haven't tried any of them so I can't recommend one.

    The reason for this might be that the target devices that cause these errors do not support compute shaders. You might want to check the erroneous devices specs to verify this.

    Hi there, the problem is there is caused by using the "Show Rendered Amount" option in the GPUInstancer GUI Info component. This option is intended only for debug purposes, and will slow down GPUI (a lot) since it reads back the GPU data to the CPU. Your profiler screen shows precisely this.

    GPUI increases GPU utilization since it moves some operations (culling, etc) to GPU as well for faster performance. The difference in utilization in different scenes would still depend in the amount of geometry being rendered.

    Most likely the issue is that the player uses a particular custom shader to take screenshots, which is not setup for use with GPUI. Or, another possibility is that an additional camera is added to take the screenshot and removed after; in which case you should use the GPUI API to handle the new camera.

    The detail density can not be changed between the instances of the same prototype. It is possible implement a custom solution by editing the compute shaders, but a generic solution for this is not available at the moment.

    Looks like this is cause by a shader with an incompatible shadow pass. You can take a look at this wiki for setting up your shader.

    Hi there,
    GPUI currently handles activation (GPUInstancerPrefabRuntimeHandler.cs) in the Start method. We will change this to the OnEnable method in the next update.

    Thanks for the feedback. Layer information is taken from the Layers that are defined by the prefab's MeshRenderer. You can change the layers on your Prefabs to have it rendered in the layers you desire.
     
  2. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Also, there are some issues with Unity version 2019.2 and the latest HDRP version. We are aware of these issues, and we are currently working on fixing the incompatibility of GPUI in these versions. These fixes will be available with the next update.
     
    N1warhead likes this.
  3. Game_DevKH

    Game_DevKH

    Joined:
    Jun 11, 2017
    Posts:
    23
    Hey, why I not build on Android?
     
  4. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
  5. thestroyer_

    thestroyer_

    Joined:
    Oct 12, 2015
    Posts:
    10
    Hi! I am having trouble trying to implement GPU Instancer in my project.

    I have a "Base" scene where I added the GPUI Prefab Manager and I added all the prototypes of the objects I will use and I configured them using the example I found in the documentation using the automatic Add/Remove Instances.
    When I hit play I load 3 more scenes additively with objects whose prototypes are in the Manager. In editor everything works fine, but when I make a development build for windows I won't stop recieving errors saying "Can not find runtime data for prototype: city_spotlight05. Please check if the prototype was added to the Manager and the initialize method was called." (not only for that prefab specifically, for all of them that are loaded inside the scenes added additively).

    Do I have to initialize the manager everytime a scene is loaded? Am I doing the set up wrong?

    I would appreciate I could have some help.

    Thanks in advance!
     
  6. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    79
    Hi -- I'm having a bit of trouble with this asset and I'm not sure how to debug.

    Before running, I registered a prefab as a prototype. It looks fine.

    At run time, I call GPUInstancerAPI.InitializeWithMatrix4x4Array with my prefabmanager. I have a dynamic player; any time it changes, I call SetCamera on the GPUInstancer. I can see that my instances were registered; the correct number is displayed. However, no draw call ever occurs.

    Total Instance Count correct, Total Draw Call Count: 0.
    I've also tried turning off all culling.

    If I call the initialization method only after setting the camera, still nothing happens. I'm using Direct3d11 in VR

    Additionally

    1. how do you deal with multiple cameras? It's enough to just have a prefabmanager per camera, and make sure to initialize per prefabmanager?

    2. Is it possible to have culling groups? For example, if I have sections of objects but I want to cull by section rather than object.

    Thanks

    Edit: I'm using Unity 2019.2

    Looks like the demo, PrefabsWithoutGameObjects doesn't work either! If I set the target eye to None, it does work.
     
    Last edited: Sep 3, 2019
  7. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hi,

    After upgrading to Unity 2019.2 GPUInstancerPrefabRuntimeHandler STOPED updating the prefab position when changing the gameobject position (modifying the gameobject.transform directly)

    After spawning, Prefab gameobject are correctly moved to the desired postion but "the graphic" is rendered above the main camera !

    Any help please ?

    ps: i'm using Unity 219.2.3f1
     
    Last edited: Sep 4, 2019
  8. Elyaradine

    Elyaradine

    Joined:
    Aug 13, 2015
    Posts:
    27
    Just bought this after seeing the really impressive documentation and demos, as well as seeing regular support.

    I just installed this in Unity 2019.2.3, and had an error in GPUInstancerUtility.cs, line 116.
    Assets\GPUInstancer\Scripts\Core\Static\GPUInstancerUtility.cs(116,50): error CS0029: Cannot implicitly convert type 'object[]' to 'uint[]'

    It looks like
    runtimeData.args
    is already a uint[], so removing the
    ToArray()
    seems to work okay (although I'm still getting to grips with setting up some test cases to see the plugin in action, so I can't test it extensively yet).
     
  9. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, it may be something I'm doing wrong, but having GPUI enabled actually slow things down for me.

    When I have just prefabs only in the scene without any non-GPUI related stuff such as Vegetation, terrain, physics simulation (they are all turned off except prefabs), GPUI helps improve the performance, compared to the default Unity batching. However, when I enable everything, using GPUI will lower the performance compared to Unity's default batching. This leads me to believe that there is some conflict that causes the slowdown. I'm using Vegetation Studio Pro, Vehicle Physics in the scene. I tried to turn each asset on/off to nail down what's causing the conflict but I wasn't able to. It is increasingly slow down.

    My scene includes prefabs with from several hundred to thousands of counts. This should be good enough to take advantage of GPUI but I'm actually getting the opposite results.

    FYI, I'm using 2019.1 and the latest GPUI
    I would appreciate if you can help me figure out.
    Thanks.

    P.S I'm kinda curious how other people are getting the perf boost using GPUI compared to the default Unity Batching. Yeah, having 10's thousands of one type of prefabs, similar to GPUI demo would definitely get the boost, but I'm curious about the more real game scenario.
     
  10. Petroglyph

    Petroglyph

    Joined:
    Jan 27, 2014
    Posts:
    4
    Hello and thank you for your inspiring work on GPUI. I have been using it in a R&D project for awhile now and got very interesting results!

    Recently I have been pushing that project to using latest Unity (2019.2) and latest Shader Graph, moving to pure ECS and HDRP. I use an editor script which takes as input the shader graph generated code and regex it to inject the necessary includes and variable declarations (for variations), since custom node is no longer an option, and since I have been unable to use the new custom function node for that purpose.

    It works great for Lit/Unlit based shader graphs, but oddly enough, only when surface option is set to Opaque. When it is set to Transparent, the object will be rendered as if being at camera space (0,0,0). It is as if there is another place where the GPUI includes should be added, but I could not find where. It is a shot in the dark, but in case you guys investigated this issue for making GPUI Shader Graph 5.x compatible, have you encountered this issue or found any clue as to where to look to make transparent generated shaders work with GPUI?

    Sorry for the very specific question! In any case, thank you for your great work.
     
  11. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    Please make sure that you are using the latest GPUI version (currently v1.2.3). If you are still getting this error, please send us the full error log so we can investigate the issue. If you are using any API methods, please include your usage in your mail as well.
     
  12. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    it looks like you are trying to use GPUI in a VR setup that uses a separate camera per eye. This is currently not supported out of the box. You can use a single camera and have Unity render both eyes from it (Target eye = both).

    If you wish to use a multiple camera setup, you can use a different manager per camera, and enable the Use Selected Camera Only option on your managers. However, the occlusion culling feature will not work when you have this setup in a camera-per-eye VR setup.

    As for culling groups, you can implement this while using a no gameobject workflow, but GPUI does not offer this out of the box.

    Also, if you see the total instance counts correct in the Manager, but if their total draw call count shows 0, it is very likely that the prefab you are using has problems (e.g. no mesh renderer defined, etc.). You would see errors/warnings in the console window if this is the case.
     
  13. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    do you see any errors/warnings in the console? and did you upgrade GPUI to version 1.2.3?
     
    838nHex likes this.
  14. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    this is most likely caused by another package in your project that overrides this method. Removing the .ToArray() would work, but might cause troubles if you use the included GPUInstancerGUIInfo component.

    Instead of removing the .ToArray(), you can do it like this:

    runtimeData.shadowArgs = new uint[runtimeData.args.Length];
    Array.Copy(runtimeData.args, runtimeData.shadowArgs, runtimeData.args.Length);
     
  15. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    GPUI does not work together with Vegetation Studio. Other than that, we can help identify the problem if you can elaborate more on your setup. What are you registering as your prototypes? What are their instance counts and how are the prefabs set up (how many renderers/lods per prefab)

    You can take a look at the Best Practices Wiki for a better understanding of the intended usages of GPUI.
     
  16. Elyaradine

    Elyaradine

    Joined:
    Aug 13, 2015
    Posts:
    27
    Thanks @LouskRad -- you're right, it was the fault of an extension method we were using elsewhere.
     
  17. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there, and thank you for your feedback.

    We haven't investigated the shader conversion issue for SRP after the shader graph custom node option was removed. However, if you can send us a sample scene that uses this shader, we can investigate the problem.

    However, please also note that out of the box transparency would not work with Indirect GPU instancing.
     
  18. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    79
    Hi -- I am actually using single pass VR with a single camera.

    The problem shows up in the demo scene as well.

    If I set the demo scene camera target eye to "none" instead of "both," then it renders correctly, even if I replace the prefab with the prefab I am using in my scene. It similarly shows the instances and no draw calls when it's not working.

    However, setting it to none in my scene doesn't do anything.

    Do you have any more tips for debugging this? Should I make a new example project demonstrating this? (Although maybe the PrefabsWithoutGameObjects scene in Unity 2019.2 is enough).
     
  19. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    We have tested this on a clean Unity 2019.2 project with only GPUI v1.2.3 added with OpenVR. We did not see any issues with the PrefabsWithoutGameObjects scene.

    If you haven't updated GPUI to the latest version yet, please do so. Otherwise, please send us a sample project showing this problem so we can investigate it.
     
  20. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hi,
    No errors, no warnings. And yes i did upgrade to GPUI v1.2.3.

    I found the issue : When i use any double sided shader as the material "the bug" happen. It happen also when i used "GPUIInstancer/Transparent/Cutout/Diffuse double sided" as material.
     
  21. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Thanks, I'm aware of this and I'm not mixing the same object on both VSP and GPUI.
    Right now, I'm traveling and I'll get back to you in about a couple of weeks but I'm just letting you know the problem and looking for some easy known answers such as conflict with other Assets.
    Cheers!
     
  22. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Hi. Im currently using VS. which is a great asset. And i know there isn't any direct comparison (that i know of). But im curious, how flexible is gpu instancer? Can scripts be attached to instanced objects? Does indirect instancing work out of the box? What are the requirements for it? For trees for example, is there a way to destroy a instanced object after its placed in the scene? Either by destroying it or placing a mask down?
     
  23. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    And how is multiple cameras set up? And with multiple cameras, thats with rendering at the same time? Not just switching.
     
  24. 838nHex

    838nHex

    Joined:
    May 14, 2014
    Posts:
    14
    new in GPUI v1.2.3.Version

    BuildNavMesh();
    StartGPUInstancer();
    results in no NavMesh (was ok in earlier versions)

    set all prefabs to Mesh Renderers Disabled = true
    StartGPUInstancer();
    BuildNavMesh();

    NavMesh back again. but this "Mesh Renderers Disabled = true" costs half of the FPS

    I switch back to 1.2.2 for double FPS.

    mostly the GPUI updates are no problem.
    but this time I was surprised without warning.
    i have no idea how to get 1.2.3 running.
    It seems to me that nothing works anymore.

    19.2 with LWRP
     
    Last edited: Sep 8, 2019
  25. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I keep getting this issue:

    I am using a pooling system and PoolBoss.SpawnInPool pretty much works the same way as instantiate but it always throws me that error from this line
    GPUInstancerAPI.RegisterPrefabInstanceList(prefabManager, spawnedGPUPrefabs);


    Code (CSharp):
    1. if (gpuPrefabs[i].useGPUPrefabPooling)
    2.                     {
    3.                         usePoolBoss = true;
    4.                         GPUInstancerPrefab prefabInstance = PoolBoss.SpawnInPool(gpuPrefabs[i].gpuPrefab, transform.TransformPoint(gpuPrefabs[i].posRots[j].position), gpuPrefabs[i].posRots[j].rotation);
    5.                         spawnedGPUPrefabs.Add(prefabInstance);
    6.                      
    7.                     }
    8.                 }
    9.              
    10.             }
    11.        
    12.             if(spawnedGPUPrefabs != null)
    13.             {
    14.                 prefabManager = GameObject.FindObjectOfType<GPUInstancerPrefabManager>();
    15.  
    16.                 if (prefabManager != null && prefabManager.isActiveAndEnabled)
    17.                 {
    18.                     GPUInstancerAPI.RegisterPrefabInstanceList(prefabManager, spawnedGPUPrefabs);
    19.                     GPUInstancerAPI.InitializeGPUInstancer(prefabManager); // Initialize the prefab manager
    20.                 }
    21.             }
     
  26. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Basically how do I register inactive prefabs?
     
  27. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    It is a shader issue then. GPUI auto converts most shaders, but for some custom and built-in shaders, you need to make sure it is compatible for GPUI. You can take a look at this wiki for information on manually setting up your shaders with GPUI.
     
  28. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there,
    you can attach scripts to your objects (when using the prefab manager), indirect instancing works out of the box, and for the requirements and further information, you can check the wiki pages and tutorial videos.
     
  29. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    You can use two managers that define the same prototypes and set their respective cameras, using the Use Selected Camera Only option.
     
  30. LouskRad

    LouskRad

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

    Can you send us a sample that shows this problem? We have no way of identifying this issue without knowing how your methods and setup in general are implemented.
     
  31. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Looks like some of your prefabInstances in the spawnedGPUPrefabs are null when you send them to the RegisterPrefabInstanceList method. You can debug your method and verify if this is the case.
     
  32. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414

    I did that, and it worked, i just thought... nah too easy. When i first set the system up. I was frustrated, i don't understand. Damn it. Till i played the scene, and it worked...... it was so ridiculously easy to set up, i thought i did it wrong hahaha, and wow HUGE performance upgrade.
     
    LouskRad likes this.
  33. Deleted User

    Deleted User

    Guest

    Hey, I recently bought GPU Instancer today.
    I hope it does a good job, I did not test it now because I want to set it up with Map Magic, I followed exactly the tutorial but once I hit Import in the Map Magic Integration Script I get an error:
    error.jpg

    Thanks for your time!
    All the best.
     
  34. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    79
    Thanks -- I misunderstood the LayerMask on the prefab manager; setting to Everything fixed my issue (also updated the plugin). It works really well! Using it on Desktop + iOS. Testing Oculus quest soon. Really grateful, I had wanted to use the DrawMeshInstancedIndirect method for a while, but the compute buffer stuff looked annoying to deal with -- your plugin has been nice to deal with.

    One more issue I'm having -- I have a camera I use to generate small previews that I manually call Render() on, it renders on to a render texture. The seats don't show up for it. I tried making another prefab manager, setting the target camera to this camera and initializing the matrices to it directly -- this didn't work either. If I leave it enabled and rendering to a render texture, then it renders the seat correctly. However, I need to do it only intermittently and would prefer not to leave it rendering.

    Any ideas on what might be causing this? Thank you
     
  35. Ajacksonthebox

    Ajacksonthebox

    Joined:
    Jul 18, 2013
    Posts:
    15
    Hello, I am trying to incorporate GPUInstancer into my project which uses Pool Boss to instantiate manage the game objects. If i just add my prefabs to the GPUInstancer prefab manager and enable Run-time Modification, Add/Remove Instances at Run-time and Auto Add/Remove Instances i find that after a while the prefabs are spawned with the Renderer disabled. How should I implement this? Will I need to register the prefabs on the spawn and despawn event or perhaps when the pool manager instantiates all the prefabs at he beginning of the level? Cheers
     
  36. 838nHex

    838nHex

    Joined:
    May 14, 2014
    Posts:
    14
    your new version does not work anylonger with unity NavMeshSurface.BuildNavMesh(); at runtime.
    the NavMeshSurface needs the MeshRenderer of the instanciated Prefabs. these MeshRenderers are not longer accesable to the NavMeshSurface. it was accesable in all previos versions.
     
  37. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hi,

    When trying to build for Android i'm getting these errors :

    Code (CSharp):
    1. Shader error in 'GPUInstancer/CrowdAnimations/Standard': undeclared identifier 'gpuiTransformationMatrix' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdInclude.cginc(24) (on gles3)
    2. ---------------
    3. Shader error in 'GPUInstancer/CrowdAnimations/Standard': undeclared identifier 'vertForwardBaseGPUI' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdStandardInclude.cginc(177) (on gles3)
    4. --------------
    5. Shader error in 'GPUInstancer/CrowdAnimations/Standard': undeclared identifier 'vertForwardBaseGPUI' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdStandardInclude.cginc(177) (on vulkan)
    6. --------------
    7. Shader error in 'GPUInstancer/CrowdAnimations/Standard (Specular setup)': undeclared identifier 'gpuiTransformationMatrix' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdInclude.cginc(24) (on gles3)
    8. --------------
    9. Shader error in 'GPUInstancer/CrowdAnimations/Standard (Specular setup)': undeclared identifier 'vertForwardBaseGPUI' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdStandardInclude.cginc(177) (on gles3)
    10. --------------
    11. Shader error in 'GPUInstancer/CrowdAnimations/Standard (Specular setup)': undeclared identifier 'vertForwardBaseGPUI' at Assets/GPUInstancer-CrowdAnimations/Shaders/Include/GPUICrowdStandardInclude.cginc(177) (on vulkan)
    Any help please ?

    On Unity 2019.2.4f1 ; Built in renders ; When targeting Windows compilation work without any problem.
     
  38. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    So i bit the bullet and upgraded to 2018.4. Just so i could get this. I regret nothing. Just playing with it, ive done some pretty impressive stuff. I havent tried to control animations of the crowd controller yet though.

    Out of curiousity, do the animator instances follow the same idea as the prefab manager with the collider trigger modifier thing?
     
  39. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    Major Slowdown on version 1.2.3 on the Android vs 1.2.2.. Not sure whats going on but v1.2.3 is very jittery on Android! Something must have changed to cause this.
     
    838nHex likes this.
  40. Black_Raptor

    Black_Raptor

    Joined:
    Nov 3, 2014
    Posts:
    181
    So i try on Oculus Quest, but that not work because Quest use Android 7.1
     
  41. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
    Hi, I might be missing something. But is there a quick start guide for HDRP?

    EDIT: To clarify: The demo scenes don't work in HDRP and I can't seem to find an HDRP package.
     
    Last edited: Sep 14, 2019
  42. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    Hi, I'm having trouble with GPU Instancer versions 1.2.2 and 1.2.3 -- Is there something special I need to do to upgrade from version 1.2.1? Whenever I upgrade, GPU Instancer breaks. Nothing in my scene gets instanced and all of the prototypes listed in my prefab manager become red.

    I've tried completely removing version 1.2.1 from my project and then importing a fresh copy of 1.2.3, but that doesn't make any difference. With either version 1.2.2 or version 1.2.3 nothing in my scene gets instanced and all of the prototypes imported into in my prefab manager become red.

    Please note this does not happen with version 1.2.1 -- With that version installed, GPU Instancer works great!

    P.S. I'm on Unity version 2019.1.14f1 targeting iOS version 12.4.1

    P.P.S. GPU Instancer version 1.2.1 is throwing errors in Xcode as well:

    Code (CSharp):
    1. Uploading Crash Report
    2. ArgumentNullException: Value cannot be null.
    3. Parameter name: shader
    4.   at GPUInstancer.GPUInstancerManager.AddTreeProxy (GPUInstancer.GPUInstancerPrototype treePrototype, GPUInstancer.GPUInstancerRuntimeData runtimeData) [0x00000] in <00000000000000000000000000000000>:0
    5.   at GPUInstancer.GPUInstancerPrefabManager.InitializeRuntimeDataForPrefabPrototype (GPUInstancer.GPUInstancerPrefabPrototype p, System.Int32 additionalBufferSize) [0x00000] in <00000000000000000000000000000000>:0
    6.   at GPUInstancer.GPUInstancerPrefabManager.InitializeRuntimeDataRegisteredPrefabs (System.Int32 additionalBufferSize) [0x00000] in <00000000000000000000000000000000>:0
    7.   at GPUInstancer.GPUInstancerPrefabManager.InitializeRuntimeDataAndBuffers (System.Boolean forceNew) [0x00000] in <00000000000000000000000000000000>:0
    8.   at GPUInstancer.GPUInstancerManager.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    9. (Filename: currently not available on il2cpp Line: -1)
    10.  
    11. Uploading Crash Report
    12. ArgumentNullException: Value cannot be null.
    13. Parameter name: shader
    14.   at GPUInstancer.GPUInstancerHiZOcclusionGenerator.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    15.   at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0
    16.   at GPUInstancer.GPUInstancerManager.SetupOcclusionCulling (GPUInstancer.GPUInstancerCameraData renderingCameraData) [0x00000] in <00000000000000000000000000000000>:0
    17. UnityEngine.GameObject:AddComponent()
    18. GPUInstancer.GPUInstancerManager:SetupOcclusionCulling(GPUInstancerCameraData)
    19. (Filename: currently not available on il2cpp Line: -1)
    Any help would be greatly appreciated -- THANKS!!!
     
    Last edited: Sep 13, 2019
  43. asdzxcv777

    asdzxcv777

    Joined:
    Jul 17, 2017
    Posts:
    29
    can the gpu instancer api be called from any thread other than game thread ??
     
  44. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    79
    I've tried on the Quest and it's working great
     
    LouskRad likes this.
  45. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Looks like your map magic rule set contains a missing/null prefab reference. Can you please check it and remove these null references?
     
  46. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    The details of how exactly you are rendering to the RenderTexture would change this a lot. For example, if you are using any replacement shaders, etc. these should be setup with GPUI as well. Also, you might be rendering from a camera where GPUI is culling the objects for your main camera.
     
  47. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    A GPUI prototype must be defined at the start of your scene (either at editor time in the manager, or from script at scene initialization), and the instances of that prototype must be registered each time after you spawn them. The Auto. Add/Remove feature automatically does that for you. The game objects are instantiated with the MeshRenderers turned of because GPUI takes over their rendering. However, I am not familiar with PoolBoss and I can't comment on what it does internally or how it can be integrated with GPUI.
     
    combatsheep likes this.
  48. LouskRad

    LouskRad

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

    Crowd animations currently does not support mobile platforms. That is why your shaders are not compiling for GLES3 and Vulkan.
     
  49. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Hi there, and thanks.

    The Modification Collider feature is currently not implemented for Crowd Animations; there are further complications than non-animated prefabs with that since the animations are supposed to sync when GPUI disables rendering for the instances inside the Collider.
     
  50. LouskRad

    LouskRad

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

    GPUI supports HDRP in the sense that it renders compatible shaders and auto-converts the built in HDRP shaders to use with itself. It does not come with HDRP shaders, and the demo scenes would not work out of the box since they use
    the Standard Shader.

    We have not added LWRP and HDRP demos to the package because the shaders of these pipelines keep changing and it is not possible to support all scenes in all the LWRP and HDRP versions GPUI works with.

    You can, however simply test GPUI by adding a prefab prototype that uses the HDRP Lit shader.