Search Unity

[RELEASED] GPU Instancer

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

  1. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437

    small note for info only
    in the latest Unity Rendering.HighDefinition.LitShaderGraphGUI they change _Color into _BaseColor
    applicable from api 10.3.2 and higher
    this is also found in LitShaderGraphGUI

    if you use _Color it will be treated same as _EmissiveColor
     
  2. Grigler_f

    Grigler_f

    Joined:
    May 14, 2020
    Posts:
    24
    Thanks for this, it solved the issue.
     
  3. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
  4. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    is there anything you can suggest to optimise this part?

    upload_2022-3-21_13-11-12.png
     
  5. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Yes. But there is a Unity shader compiler bug in versions 2021.2.8 to 2021.2.11, so there will be issues if you use these versions.
    Your applications performance might be bound by another process. You need to first figure out what is the cause of the performance problems. For example, HDRP has many features that can cause performance issues that is not related to rendering tree instances.
    If you have high amounts of prototypes, I would suggest reducing the amount. Compute shader dispatch calls and draw calls can not be threaded so they can affect performance when there are too many prototypes. Other than that I can not say much without detailed information.
     
    keeponshading likes this.
  6. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    Thank you, I thought it was instance based and not prototype based, as if instances = 0 for a given prototype the dispatch would be skipped. I need to refresh my knowledge of your code, my memory is so volatile.

    Edit: I checked and indeed the dispatch won't be executed if the number of instances is 0

    On a similar note, I am trying to remember how GPUI culling is affected by the Camera far clip plane, I don't remember where the value is read and I cannot find it searching through the code

    Edit: ok, i remembered this too. MaxDistance is a quick check between centers and do not take in consideration the extension of bounding boxes so it's ok for small things. The camera far clip plane is used as expected but the value is read from the camera projection matrix directly.
     
    Last edited: Mar 22, 2022
  7. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    We're still having this issue with a GPU Instancer's tree manager crashing a Mac (it usually requires the whole computer to be restarted rather than just crashing Unity). We've narrowed it down to the fact that having more than 15 tree prefabs causes the crash, but it runs fine with less. Any ideas if that is just a coincidence or if that might be an indication of where the issue might be? We tried with different trees and it doesn't appear to be the specific trees in use.
     
  8. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Hello again, I am using the DetailManager to instance my terrain details. I am creating holes and raising/lowering portions of my terrain at runtime and I would like to update the GPU Instanced details accordingly. Is this possible or is this something that could be added?

    For example, just as it is possible to remove details within bounds, I would like to update the detail positions within bounds to the new terrain shape.
     
    Last edited: Mar 23, 2022
  9. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    I noticed that this line is now crashing when I enable the occlusion culling (which has been off in our project for a long while, so I am not sure when it broke). This because graphicsFormat of the depth texture results to be none. We are using HDRP 12/Unity 2021.2, we are not using the latest version of GPUI. the
    _CameraDepthTexture looks like this:

    upload_2022-3-23_14-33-50.png

    Edit: updating GPUI seems to have resolved the problem, but surely the occlusion doesn't behave like I'd expect. Maybe it's because we are using custom shaders and we are not doing something that GPUI needs us to do?

    I am looking at the direction of the red arrow:

    upload_2022-3-23_16-55-32.png

    this is with occlusion On (which is doing something, but not what I am expecting):

    upload_2022-3-23_16-55-45.png

    and this is with Frustrum Culling on:

    upload_2022-3-23_16-56-12.png

    the depth texture seems to be reasonable and what I expect

    upload_2022-3-23_16-59-55.png
     
    Last edited: Mar 23, 2022
  10. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    I recommend reporting this to Unity. There is not much we can do for editor crashes on specific hardware. It is most probably a Unity bug. There might also be a hardware limitation, but even then it should be handled by Unity and logged.

    Hi there,
    Unfortunately, height map is stored during initialization and it would require re-initializing the Detail Manager. We are not planning to add further runtime modification APIs to the detail manager (current design is not very suitable for it). We are experimenting on a new system which would also allow runtime modifications on terrain details but I can not tell if and when it will be available.

    I was not able the understand the issue here. If you can email us a sample project with detailed explanation of the problem, we can investigate.
     
  11. DigitalChaotics

    DigitalChaotics

    Joined:
    Dec 18, 2013
    Posts:
    25
    I've scoured the forum, and can't find this anywhere. I want to use the No-GameObject approach, and for whatever reason cannot get anything but the Demo to work. I know it's me, and not GPUI, but still... ...frustrating. It's especially frustrating because what I want/need seems so easy.

    What I really want is this: a simple MonoBehaviour class that completely encapsulates GPUI, and provides direct access to the core Matrix4x4 array of instances. It should have one interface method:

    public void Draw(GameObject prototype, List<Matrix4x4> places);


    The 'places' is where I'd like the instances to appear.

    The prototype passed in is an unadorned GameObject. Consider it just as dynamic as the 'places': it could change with every call.

    That's it. The MB instance should dynamically create and maintain the necessary infrastructure internally (e.g., GPUInstancerPrefabManager, GPUInstancerPrefabs, etc.), and then just make it happen. I don't want to know the details - not from the outside. I don't want to have any public exposure of GPUI at all. I just want a simple facility to make things magically appear on the screen where I tell them to be.

    Any suggestions? Is this class already out there someplace, and I missed it? This seems like something everyone could use.
     
  12. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,

    For defining prototypes at runtime you can use the DefineGameObjectAsPrefabPrototypeAtRuntime API method.
    And for initializing and updating instance data, you can use the InitializePrototype and UpdateVisibilityBufferWithMatrix4x4Array API methods.

    GPUI does not have a simple "Draw" method because it would be slower and make unnecessary memory allocations. Unity already has such a method called Graphics.DrawMeshInstanced, but it is limited and in most cases slower.

    Very often in programming simplest way of doing things is not the optimized way. GPUI is designed this way to reduce memory allocation and data transfer to GPU.
     
  13. Taylor250

    Taylor250

    Joined:
    Mar 21, 2019
    Posts:
    3
    Hello everyone,

    I'm using the latest version of HDRP (13). Sadly Cross-Fading makes the object transparent while transitioning.
    Any idea how to fix this?

    Thanks.
    upload_2022-3-28_15-0-9.png upload_2022-3-28_15-0-36.png
     
  14. DigitalChaotics

    DigitalChaotics

    Joined:
    Dec 18, 2013
    Posts:
    25
  15. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi,

    I have a small question.
    I have trees and bushes in my scene that make use of the GPUI tree manager. Since I plan to the detail manager to draw grass clump prefabs, would it make sense to draw my bush prefabs also using the detail manager instead of the tree manager? Is there any performance advantage?

    Thanks
     
  16. littenli

    littenli

    Joined:
    Dec 18, 2019
    Posts:
    33
    hi, report a bug.

    In the "ChangeMaterial" function of GPUInstancerAPI.cs file, the length of "proxyRenderer.materials" and the length of "gpuiRenderer.materials" are not necessarily equal.

    This will cause an error in "proxyRenderer.materials[subMeshIndex]".

    Maybe there should be an assignment operation first?
    Code (CSharp):
    1. proxyRenderer.materials = new Material[gpuiRenderer.materials.Count];
     
  17. Eloujah

    Eloujah

    Joined:
    Apr 28, 2014
    Posts:
    24
    Hi,

    I'm reporting an issue I'm encountering when a scene with GPU Instancer is loaded on the a server/headless version of the game build. The server simply crashes. It works perfectly on the client version of the buid.

    Here is the crash report: https://pastebin.com/0XCvszPK
    The Unity version is 2019.4.35f1 and the GPU Instancer version is 1.7.2.
    The server is running on Amazon Linux 2018.03, and doesn't have a GPU (AWS EC2 r4.large).
    Here are some hardware info:
    Code (JavaScript):
    1. Hardware Info
    2. ---
    3. Graphics Device Name: Null Device
    4. Graphics Device Type: Null
    5. Graphics Device Vendor: Unity Technologies
    6. Graphics Device Vendor ID: 0
    7. Graphics Device Version: NULL 1.0 [1.0]
    8. Graphics Memory: 128
    9. Graphics MultiThreaded: False
    10. Graphics Shader Level: 50
    11. Max Compute Buffer Inputs: 0
    12. Processor Count: 2
    13. Supports Compute Shaders: True
    14. Supports Instancing: False
    15. Memory: 15285
    It is only happening one 1 scene, but it is working on the 2 other ones which also contains GPU Instancer.

    Thank you,

    Best regards,
    Elouan
     
  18. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi,

    I have a small problem. I applied the detail manager to my terrain. After that my grass tuft prefab, I used as terrain detail, looks like it´s placed in a grid? Any idea how to make it look normal?

    https://imgur.com/l7biXjc

    Thanks
     
  19. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,
    Please make sure to upgrade to the latest version of GPUI (currently v 1.7.2) from the Asset Store. If the issue still exists in the latest version, please email us a bug report following this guide.

    This method will create ScriptableObjects and they will be saved as an asset that will be serialized with the Prefab Manager in editor mode. We put this limitation so that the users do not unintentionally serialize and create many files for temporary GameObjects.
    If you wish to manage the prototypes in editor mode, you can edit the prototypeList and prefabList fields in the Prefab Manager, and control what gets serialized and what does not. You can take a look at the code of this API to get an idea.

    Hi there,
    Detail Manager is optimized for having many instances in a small area such as grass. But if the instances are distributed sparsely, it will not be ideal. So it depends on how your bush prefabs are distributed. If they are distributed like trees with spaces between them and the instance counts are not that high, it is better to use Tree Manager.

    Hi there,
    and thank you for the feedback. We will make the necessary changes in the next update.

    Hi there,
    From the error it looks like the compute shaders are not imported correctly (Kernel not found). This sometimes happens in Unity when the files are moved. Usually solved by Reimport.
    I am also not sure why you need GPUI on the server side. If the issue persists, please email us detailed information about your setup so we can investigate.

    Hi there,
    I am not sure what caused this. Can you please email us a sample project so we can investigate?
     
  20. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi Gurhan,

    I could fix the grid appearence by restarting the unity editor. Strange but it worked✌️.
     
  21. Eloujah

    Eloujah

    Joined:
    Apr 28, 2014
    Posts:
    24
    Hi,

    Yes, you are right. There is no need for GPUI to be on the server side. Does removing GPU_INSTANCER from the symbols will completely disable GPUI ?

    Thank you,

    Best regards,
    Elouan
     
  22. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    No, the GPU_INSTANCER script define is for other plugins to recognize that GPUI is present. It does not effect how GPUI works. You need to remove the managers from the scene to completely disable GPUI.
     
  23. Eloujah

    Eloujah

    Joined:
    Apr 28, 2014
    Posts:
    24
    I understand. But is there a way to disable it easier and more globally without having to change manually the scenes?
    Like, we have a lot of scene using it, and we are compiling the same project for the client, and for the server (headless mode). It is therefore not viable for us to change the scenes between the client and the server. Is it possible to have something like GPUI_DISABLED or a static variable with the GPUI API like
    GPUInstancerAPI.Enabled = false
    ?

    Thank you very much
     
    Last edited: Apr 4, 2022
  24. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    You can add a simple code at the top of the Awake method inside GPUInstancerManager.cs to disable the managers.
    Such as:
    Code (CSharp):
    1. public virtual void Awake()
    2. {
    3. #if GPUI_DISABLED
    4.     this.enabled = false;
    5.     if (!this.enabled) // to avoid unreachable code warnings
    6.         return;
    7. #endif
    8.     ...
    Please note that additional scripts that uses GPUI API, if there are any, also needs to be disabled since most of them are dependent on the managers.
     
  25. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    it appears to me that Unity does not cross fade models between the furthest LOD and the Cull state (which would mean a fade out basically)

    upload_2022-4-5_16-24-53.png

    and if I am right, I think it's a big shame. Would it be possible to enable the behaviour with GPUI?
     
    Last edited: Apr 6, 2022
  26. littenli

    littenli

    Joined:
    Dec 18, 2019
    Posts:
    33
    There are dozens of tree prefabs in my game.

    Because there are so many, I don't want to add them to the "GPUInstancerPrefabManager" one by one.
    My idea is that if a tree is used at runtime, just add it to the PrefabManager. Because sometimes, the player's archive scene may only have some of these trees.

    I don't know if this is a reasonable way to do it?
    Does it have any side effects than adding all resources in advance?

    -------

    Then I also encountered some problems when I tried to add prototype at runtime.
    1. first I need to load the prefab (runtime).
    2. check if the prefab has a "GPUInstancerPrefab" component.
    3. call "GetPrototypeList" to find out if it has been added (perhaps you can directly provide a function to check?)
    4. if not added, then call "AddPrototoypeToManager"
    5. call "InitializePrototype"

    Code (CSharp):
    1. public void AddToManager(GameObject obj) {
    2.     GPUInstancerPrefab gpuPrefab = null;
    3.     obj.TryGetComponent<GPUInstancerPrefab>(out gpuPrefab);
    4.     if (gpuPrefab != null) {
    5.       var protoType = gpuPrefab.prefabPrototype;
    6.       var protoTypeFound = GPUInstancerAPI.GetPrototypeList(prefabManager).Find((em) => {
    7.         return em == protoType;
    8.       });
    9.       if (protoTypeFound == null) {
    10.         GPUInstancerAPI.AddPrototoypeToManager(prefabManager, gpuPrefab.prefabPrototype);
    11.         GPUInstancerAPI.InitializePrototype(prefabManager, gpuPrefab.prefabPrototype, 10000, 0);
    12.       }
    13.     }
    14.   }
    Snipaste_2022-04-06_00-35-59.png
    Then we encounter an error.

    I wonder if there is something wrong with my code above?
    Also I don't quite understand what the "bufferSize" parameter of the "InitializePrototype" function should be?

    I just want to add it dynamically to the Manager.
    Please help me, thanks!
     
  27. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Yes it is possible. Try making the following change and see if it is what you need:
    GPUInstancer/Resources/Compute/Include/Camera.compute at line 55:
    from this:
    Code (CSharp):
    1.     if (oldLodNo < 9 && lodNo < 9 && oldLodNo != lodNo)
    to this:
    Code (CSharp):
    1.     if (oldLodNo != lodNo)
    Looks like you want to use various Runtime Settings (e.g. Auto. Add/Remove Instances) in combination with AddPrototoypeToManager API. This will cause issues with the InitializePrototype API, because it is mainly designed for no-GameObjects workflow and can not be used in combination with Auto. Add/Remove or Auto. Update Transform features.
    Try using InitializeGPUInstancer API instead, and see if it solves the issue. Such as:
    Code (CSharp):
    1. GPUInstancerAPI.AddPrototoypeToManager(prefabManager, gpuPrefab.prefabPrototype);
    2. GPUInstancerAPI.InitializeGPUInstancer(prefabManager, true);
    "bufferSize" parameter determines the GPU memory allocated by the Compute Buffers (e.g. the size of your Matrix4x4 array when using no-GO workflow).
     
    sebas77 likes this.
  28. paradyze

    paradyze

    Joined:
    Dec 16, 2014
    Posts:
    6
    Hi, gpuinstancer works fine on editor, but it does not work at build, any idea?
     
    Claytonious likes this.
  29. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    There is a Unity shader compiler bug in versions 2021.2.8 to 2021.2.11, so there will be issues if you use these versions. In this case, you should upgrade your Unity version (e.g. 2021.2.19).
    If you are not using these Unity versions, please make a bug report with detailed information following this guide.
     
  30. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi,

    I have a question. Lets say I have Detail Manager setup for all of my terrains. All terrains use the same detail objects (grass). The problem I am facing now is that GPU instancer has created a prototype for my grass detail object at every detail manager and I have one detail managers prototype configured. I now want to use that configured prototype of my grass detail at every detail manager. How do I do this? Or does every detail manager need its seperate prototype of the same grass detail? If so, is it possible to copy past the settings from one prototype to every other detail manager? so all detail managers with its created prototypes have the same settings without configuring it for each manager manually?

    Thanks ;)
     
    Last edited: Apr 9, 2022
  31. niallslater

    niallslater

    Joined:
    May 9, 2017
    Posts:
    6
    Hi! I bought this for use in a Quest 2 project, so I'm using the latest version of URP and unity 2021.2.18f1. I'm rolling my own terrain system rather than using Unity's (I'm just generating a low-poly mesh and using it as a terrain) so I don't think I can use the tree-specific tools.

    It's mostly working well, but when I try to generate custom billboards I get this slightly mysterious error:

    upload_2022-4-10_12-32-36.png

    I thought I might have to update URP but it's already on version 12.1.6. When I use the default Quad as a mesh then the billboards are all 1 unit squared, which is way too small. Do I just need to provide a larger Quad mesh, or can I get the generated ones working? Thanks!
     
  32. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,
    Each Detail Manager uses its own prototype settings. But if you have multiple terrains with exactly the same detail prototypes, you can copy the prototypes from one Detail Manager to the others.
    I attached an example code to this post which allows you to copy prototypes from source to target managers:
    upload_2022-4-11_15-25-59.png

    Hi there,
    GPUI does not support Quest 2. You can see the supported platforms from the Minimum Requirements.
    As for the Billboard warning, it might be because GPUI was not able to find the URP Billboard shader. Please make sure that the unity package under GPUInstancer/Extras/GPUI_Billboard_URP_Support is exported in your project and GPUInstancer/Shaders/Billboard/BillboardURP_GPUI.shadergraph has no errors.
     

    Attached Files:

    marcell123455 likes this.
  33. Simunek

    Simunek

    Joined:
    Jul 15, 2016
    Posts:
    49
    Hi, I serialize all GameObjects in the scene as matrix4x4 arrays, and then I pass them to GPUI in Start(). The problem I have is that I (obviously) don't see them in the editor. From what I saw in the documentation, it should be possible to render them; where should I look to find the code that does that? / What API should I use? Thanks! :D
     
  34. XperienceGame

    XperienceGame

    Joined:
    Apr 16, 2013
    Posts:
    6
    I've a tiny problem. When I use the GPUI detail manager on terrain, all my details terrain disappear, and I've no FPS gain (only 2 fps). I've no instances in detail manager. I've only one prefab on my detail terrain, but nothing instancing by script. o_O

    Only my density detail terrain on Unity's terrain change my FPS average. With or without the script.

    I'm lost.

    Script disable (before) (FPS average : 10 - 20) :


    Script enable (after) (FPS average : 12 - 20):


    To the begining, I thought it was because of the ColorMap applied to grass prefab on detail terrain, but no. After I think it's because of Gaia ?

    It's been a week that I try to optimize everything, but I don't want to go from Gaia or the rendering system of my grass in adequacy with the texture of terrain.

    An idea with this tiny problem ?
     
  35. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,
    you can use the StartEditorSimulation-StopEditorSimulation API methods. Please check the attached unitypackage for an example usage.

    Hi there,
    If you are not seeing the details, there might be a third party tool that is modifying the terrain position at runtime. If this is the case you need to enable Use Floating Origin option under Scene Settings on the Detail Manager.

    As for the performance, Detail Manager prototypes has shadows and cross-quads enabled, which improves the visual quality but lowers the performance gain. You can disable these features to get a better performance. Please also read the Best Practices documentation for information on Detail Manager performance.

    If these does not help, please email us a sample project (e.g. a scene with minimum amount of content to show the problem), so we can investigate.
     

    Attached Files:

    Simunek likes this.
  36. XperienceGame

    XperienceGame

    Joined:
    Apr 16, 2013
    Posts:
    6
    Thank for response. I discovered one thing, after many manipulations. The problem it's not linked to terrain position. I use a custom stylized material with my prefab grass. And it's the problem. After tests with classic billboards and other shader, the GPU detail manager work like a charm, but with a custom shader it's doesn't work.

    The custom shader come from the "Stylized grass" asset package by Staggart Creation. And link the shader to render "color map" texture of terrain, with that, grass follow color of terrain's texture. A little like "Zelda Breath of the wild". It's more visual smooth transition between the grass and terrain's texture.

    I going to continue experiments, with a custom visual graph shader for see.
     
  37. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    Hi there,
    Really enjoying this asset. But I need some help in regards to GPU memory allocation.
    I am using the No-GameObject workflow where I initialize the GPU buffers for prefabs using
    GPUInstancerAPI.InitializeWithMatrix4x4Array() and GPUInstancerAPI.UpdateVisibilityBufferWithMatrix4x4Array() methods.
    My question is how to completely reclaim all the memory previously allocated on the GPU? How to reclaim the memory for a particular prefab-Prototype and how to reclaim the memory for all prefab-Prototypes allocated for the buffers. I am having some trouble understanding which API methods would be used to do this properly.
    Thanks in advance for any help.
     
    Last edited: Apr 16, 2022
  38. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    When I use GPUInstancer for SpeedTrees, they have no wind. Their wind does work correctly when not using GPUInstancer.

    These are SpeedTree8 tree assets on Unity 2021.3.0f1, using URP 12.1.6

    I've tried using the GPUInstancer/Universal Render Pipeline/Nature/SpeedTree8 shader, I've tried letting it auto-update the regular URP SpeedTree shader, and I've tried my own copy of the SpeedTree8 shader, but I can't seem to find any way to make wind animation work.

    Does GPUInstancer support wind animations on SpeedTree8 trees in URP? If so, how should it work?

    Thanks!
     
    keeponshading likes this.
  39. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    I found the problem with this (so posting to maybe help others): my tree prototypes were originally non SpeedTrees (they were Nature Manufacture assets in my case). I changed the prefabs in the GPUI Tree Manager to the new SpeedTree trees at a later time. This "worked" except that they had no wind animation. I noticed today that the scriptable objects for these prototypes referenced by the GPUI Tree Manager have a "Tree Type" field which was set to "None". I manually changed it to "SpeedTree8" on each of these and - poof - wind animation is now working correctly.

    So everything probably would have worked fine out of the box if I had used SpeedTrees in the first place when setting up the GPUI Tree Manager, but since I *changed* from other trees to SpeedTrees, this setting didn't get magically set to the correct value, so GPUI didn't know to pass the wind parameters to their shaders.

    All working now, though, and amazing as always. This is such a powerful asset.
     
  40. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    Does this asset provide terrain streaming?
    That's it can it make a 16km x 16km terrain process faster?
     
  41. roundyyy

    roundyyy

    Joined:
    Dec 23, 2019
    Posts:
    112
    When using same trees prefabs on different scenes, with different lighting conditions, baked billboards textures overwrite bakes on different scenes. this is very problematic, cause when working on certain scene, I need to go back to others and check if nothing was changed (usually it is). Please divide ProtoypeData to various folders with scene name. Also many times billboard bakes completely black, have no idea how to solve it. Sometimes they bake ok, sometimes not on the same shaders
     
  42. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    976
    What is the status of the asset on 2021 LTS? Are the issues in previous 2021.x versiones resolved?
     
  43. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,
    There is currently no API method for releasing buffers manually, but we will consider adding it. You can use the following to release the buffers:
    For all prototypes:
    Code (CSharp):
    1. GPUInstancerUtility.ReleaseInstanceBuffers(myManager.runtimeDataList);
    For a specific prototype:
    Code (CSharp):
    1. GPUInstancerUtility.ReleaseInstanceBuffers(myManager.GetRuntimeData(prototype));
    Hi there,
    thank you for the feedback and your kind words.
    GPUI determines the tree types when the prototypes are first created, so changing shaders later would cause this issue. We will look into detecting these changes without compromising editor performance.

    Hi there,
    GPUI provides tools to render Terrain trees and details using indirect GPU instancing. It does not have a streaming system for terrains.

    Hi there,
    and thank you for the feedback.
    We will look into this issue. If you can email us detailed information following this guide, it would help us reproduce the problem.

    Hi there,
    If you mean the shader compiler bug in builds. They were only present in versions 2021.2.8 to 2021.2.11. So there should not be any issues on 2021 LTS.
     
    pratt_timmy and mrCharli3 like this.
  44. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Hello again, I am experimenting with GPUI for certain meshes and it is a bit tedious with the current workflow. I was wondering if it would be possible to add an option to the prototype manager to temporarily disable GPUI for specific prototypes rather than having to add and remove the prototype each time.
     
  45. JGameMaker92

    JGameMaker92

    Joined:
    Oct 15, 2014
    Posts:
    96
    06D2CA31-2F75-4B60-8F09-1C7546D69C73.gif

    GPU Instancer is causing shadows to form where they’re not supposed to and move with my camera. How do I fix this? It only goes away when I turn off GPU Instancer
     
    Last edited: May 2, 2022
  46. niallslater

    niallslater

    Joined:
    May 9, 2017
    Posts:
    6
    Hiya,

    Thank you for the reply - I understand Quest 2 isn't officially supported so I don't expect any help in that area. That said, I have been seeing good results so far. I'm rendering about 35000 low-poly trees on-device and GPUI has brought it from 15fps to about 65fps. The performance is good and I think with working billboarding it'll be even better.

    You were right about the BillboardURP_GPUI.shadergraph file - that's got the following error:

    Code (CSharp):
    1. Shader Graph at Assets/GPUInstancer/Shaders/Billboard/BillboardURP_GPUI.shadergraph has 1 error(s), the first is: Validation: Could not find Sub Graph asset with GUID b5acde5761ec82b4bb8d94a8f8bd0b9c.
    2.  
    And here's where the error displays in the shader graph.

    upload_2022-5-2_16-15-1.png

    I've tried re-importing the whole package in case it's lost track of where the subgraph file is, but no luck. Do you know what the problem might be?

    Edit:

    Never mind, fixed it! Looks like the GPU Instancer Setup subgraph was missing from my Shaders/Include folder. I cleared my cache and reimported and it's working now.
     
    Last edited: May 2, 2022
  47. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    Hi there,
    and thank you for the feedback.
    The managers are not designed to have specific prototypes disabled, you can only disable/enable the manager itself. I agree that a prototype based option would be useful and I will add this to our roadmap. However I can not tell when it will be available, since it will require many changes and tests for different use cases. For now I recommend using the API to add-remove instances of a specific prototype.

    Hi there,
    This is caused by the tree shader, which does not have a correct setup for GPU instancing in its ShadowCaster pass. Specifically it is missing the UNITY_SETUP_INSTANCE_ID call in the vertex method.
    You can see detailed information about shader setup from this documentation.

    I am not sure what exactly is causing the problem. You should check the GPU Instancer Setup node and find out what is causing it. Possibly a meta file issue. Files and sub graphs are referenced through GUIDs so if the meta files are modified, the references would be lost.
    Try extracting the GPUInstancer/Extras/GPUI_ShaderGraph_v5.x_or_Later_Node package and see if there are any changes on the shader files. If there are, that means there was a modification. Then you can either make sure to keep file metas as the original, or setup the references manually with the new metas.
     
    838nHex and chadfranklin47 like this.
  48. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    976
    What is the best way to identify animations using crowd animator? From what I can see I have to use an index, which is quite hard to remember when you have 50 animations.

    For example if I want to play animation "Chop wood" I have to memorize that its index 34.

    Say I were to use an enum to keep track, then next time I bake the animation all the orders change if I add an animation to my controller. It just seems very unstable.
     
    Last edited: May 3, 2022
  49. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    976
    When I enable bone updates I get the following error, I only activate hand bone.
    upload_2022-5-2_16-58-35.png

    Looks correct since this is the inspector after I hit play:
    upload_2022-5-2_17-10-10.png

    The error persists as long as I enable bone updates, no matter how many time I try to re-do the process.

    Unity 2021.3.0 LTS, latest GPUI versions.
     
    Last edited: May 3, 2022
  50. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    539
    mrCharli3 likes this.