Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] GPU Instancer

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

  1. Hugo99999999

    Hugo99999999

    Joined:
    Jun 8, 2022
    Posts:
    21
    Tree Manager/Detail Manager/Prefab Manager, can be used in a scene at the same time, use a camera to get three managers?
     
  2. mezzanine510

    mezzanine510

    Joined:
    Mar 7, 2018
    Posts:
    5
    Hello, I've figured out that the reason GPUInstancer is crashing for me when I add trees or foliage to any managers in URP 2022.2: I'm using the Forward+ rendering path. Using normal Forward rendering works as intended. Is there a way to work around this? If not, are there plans to implement support for Forward+ rendering? I'd love to know as my project does rely on Forward+ for gameplay reasons. Thanks!
     
    Last edited: Apr 23, 2023
  3. Hugo99999999

    Hugo99999999

    Joined:
    Jun 8, 2022
    Posts:
    21
    Hello, I have solved the last problem. I would like to ask about the 300 1000m terrains in my scene, each with trees/grass/prefab. Is my Tree/grass/prefab manager in a scenario where it will not uninstall? Or is there a separate administrator for each terrain? Can you tell me? thank you:)
     
  4. JGameMaker92

    JGameMaker92

    Joined:
    Oct 15, 2014
    Posts:
    96
    "Metal: Vertex or Fragment Shader "GPUInstancer/FoliageURP_GPUI_SG" requires a ComputeBuffer at index 7 to be bound, but none provided. Skipping draw calls to avoid crashing."

    This keeps popping up in the editor over and over and is causing problems
     
  5. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    GPUI disables Mesh Renderers and LOD Groups because it takes over rendering and LOD calculations. If you enable these components, it will cause conflicts and performance issues.

    Hi there,
    I was able to recreate the issue. It looks like it is caused by the orthographic camera used for rendering previews on the inspector. We will look into this in more detail for the next update. For now, you can add this line of code for a temporary workaround:
    GPUInstancerPreviewDrawer.cs at line 152
    Code (CSharp):
    1. if (GPUInstancerConstants.gpuiSettings.isURP) return gameObject != null ? AssetPreview.GetAssetPreview(gameObject) : null;
    It should look like this:
    upload_2023-4-24_21-51-15.png

    Hi there,
    I am not sure if I understand your question correctly. But if you are asking how to set up the different managers with multiple terrains:
    Prefab Manager works based on prefab instances, it has no reference to the terrains.
    One Terrain Manager can be used for multiple terrains. Please see Using the Tree Manager with Multiple Terrains.
    You need to have one Detail Manager for each terrain.

    Hi there,
    I made some tests on Metal and was not able to recreate the issue. Can you please email us a sample project following this guide so we can investigate?
     
  6. andrew_unity628

    andrew_unity628

    Joined:
    Apr 1, 2020
    Posts:
    9
    Great asset! Thank you. I'm using a no game object workflow. Question is around the "buffer size." I currently start with a buffer size of 0 and just add entries on-the-fly each time something is added to the scene, then call InitializeWithMatrix4x4Array. This works okay, but I'm wondering if it's more performant to instead allocate the maximum buffer size at the start and then just update positions via UpdateVisibilityBufferWithMatrix4x4Array. Almost like object pooling. The only concern I have if that's the approach is how to essentially disable those in the buffer which aren't needed until they are.

    UPDATE: I ended up just creating the full buffer up-front and placing their transforms very far away with a scale of zero when not needed. Looking forward to your advice on what's best-practice in this case to see if I missed the mark. Thanks.
     
    Last edited: Apr 26, 2023
  7. andrew_unity628

    andrew_unity628

    Joined:
    Apr 1, 2020
    Posts:
    9
    I'm using the "no game object" workflow and I'm noticing a difference between game object shadows and the GPUI shadows. This image compares them -- the GPUI no-game object shadows are blockier. It's like they're not taking alpha into account.
    bug-shadows.png
     

    Attached Files:

  8. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    It would be faster to start with the full buffer. You can use the "instance count" value to specify how much of the buffer size you are using (see SetInstanceCount), which will tell GPUI to avoid making unnecessary calculations for unused indexes. Also Matrix4x4.zero or zero scaled instances are culled by GPUI so you do not have to position them far away. Please see No-GameObject Workflow for more information.

    Please see Shadows on the Prefab Instances Look Blocky/Wrong.
     
  9. Daezalus

    Daezalus

    Joined:
    May 16, 2020
    Posts:
    9
    Hey guys, any update on grass bending? It's mentioned it's possible to add grass bending to the GPUI Foliage shader - is this still achievable with the latest version? Would you mind pointing us to the appropriate area in the shader where to implement this? I'm following some seperate tutorials to try and figure it out, but any help would be greatly appreciated.

    Thanks in advance
     
  10. Morcrist

    Morcrist

    Joined:
    May 7, 2015
    Posts:
    9
    I've had issues where there will be a "phantom" tree prefab attached to the edge of my player camera that constantly flashes in/out of existence, so to speak. I've also noticed that when this is happening there is also an unwanted GPUI Tree Manager Proxy gameobject created with several GPUI generated tree prefabs created under it. When I delete this object (in the editor at runtime or in script like I'm currently doing at game start), the problem completely goes away.

    For now the manual deletion is taking care of the problem, but any ideas on why this is even happening? And do you need more info/data/screenshots to help you figure out what's going on?
     
  11. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    Hi Gurhan, I am trying to use the no Game Object workflow but am getting an error:

    "Can not find runtime data for prototype: GrassPatch. Please check if the prototype was added to the Prefab Manager and the initialize method was called before update."

    I have checked the Manager and the prefab is there, and the prototype is referenced correctly. In fact this is the same prefab prototype I was using as a GameObject.

    I had a look at the example scene and as far as I can tell I have setup everything the same way.

    I even went through the whole process of deleting everything and redoing all of the prototype setup again and still get this error.

    Any ideas?
    [EDIT]

    I have solved this problem by creating 2 Managers, one for GameObjects & one for Indirect Instancing.
     
    Last edited: May 2, 2023
  12. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Foliage shader does not have bending feature and currently we are not planning to add new features to it.
    Please note that you can use other shaders for texture detail prototypes using the Custom Material setting.

    Hi there,
    For prototypes with SpeedTree shaders GPUI creates a proxy tree over the camera to sample wind values. It should normally be invisible. I am not sure why it is visible in your case. If you can email us a sample project following this guide, we can investigate.
     
  13. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    Hi again Gurhan,

    I am using The Vegetation Engine's Snow Global Overlay, when I Generate a Billboard for a Snow covered tree, the snow is not visible in the atlas.

    I could be wrong but I had a look at the code that renders the billboard and it looks like it doesn't even use the shader the prototype is using, it grabs the albedo and normal map and uses it in another shader for the rendering. I can imagine there are reasons for this, perhaps to ensure the lighting it right but it does mean the billboard doesn't end up looking right. I might have to hand paint over the generated billboard to get it to look sort of right.
     
    Last edited: May 3, 2023
  14. AngelGalaxyOfficial

    AngelGalaxyOfficial

    Joined:
    Apr 10, 2021
    Posts:
    16
    Alright, well then it leads me onto a different issue:

    I have 4 LOD levels. Three of them are LODs of varying quality and the fourth one is the Amplify Impostors Impostor LOD.

    When I instance it using GPU Instancer Prefab Manager and add the custom billboard, when I enter play mode, the LODs don't seem to change. It'll only be LOD0 or it'll fade into the Billboard once it hits a certain distance. It doesn't seem to take into account the rest of the gameobjects LODs.

    Am I doing something wrong here?
     
  15. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Please see this post where this question was answered before.

    If you have the imposter as an LOD, you do not need to use the Custom Billboard setting. You can disable the "Generate Billboard" option and the impostor should be rendered based on the LOD setting.
     
  16. pierre92nicot

    pierre92nicot

    Joined:
    Aug 21, 2018
    Posts:
    57
    Hi, is GPUI compatible with VR + HDRP12 (latest 2021 LTS) ?
    On a clean project, using the DetailInstancing scene, everything works fine until I enable VR (OpenXR).
    With VR enabled, the only way for GPUI to render somethings is to disable frustum culling.
    Here is the depth texture I get : upload_2023-5-8_22-59-37.png
     
  17. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Can you please contact the support email with detailed information (such as VR settings, Quality settings, HDRP settings, etc.) or send us a sample project, so we can reproduce the issue on our side?
     
  18. AngelGalaxyOfficial

    AngelGalaxyOfficial

    Joined:
    Apr 10, 2021
    Posts:
    16
    The issue is that I'm not noticing any of the LODs changing. It's either stuck on LOD0 or swapping to the billboard/impostor. This is why I wanted to use the LOD Group but since I can't, what could be the cause of this? Anything to try? This is quite an issue for me if everything is stuck either on LOD0 or going to the impostor/billboard after x distance.
     
  19. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    You can use LOD Groups. I think you misunderstood how GPUI works. GPUI disables the LOD Group component on the prefab instances because GPUI does the LOD calculations itself based on the LOD Group component settings on the prefab. You can see that we also use LOD Groups on various demo scenes and LODs work without issues.
    Make sure that you have the LOD Group component on the parent GameObject of the prefab that you added on the GPUI Manager and LODs will be rendered based on the LOD Group settings even tough the component is disabled on the instances at runtime.
     
  20. VolvoMan

    VolvoMan

    Joined:
    Dec 17, 2022
    Posts:
    9
    Hello

    I just got this asset and tried using the GPUI prefab manager to see what performance increase I get. I have a lot of grass prefabs instances in my scene, and I have added them to the GPUI Prefab Manager. It seems that there barely is a performance increase when I use GPU instancer. However, I can see that for example the tris count gets drastically reduced. Basically, GPUInstancer seems to be doing it's magic, but I can't really see the FPS changing much.

    It can be worth adding that I am using grass prefabs from the Staggart Creations Stylized Grass asset pack. I've painted these grass prefabs on a plane game object using Polybrush.

    Would appreciate some help with this.

    Thanks
     
  21. pierre92nicot

    pierre92nicot

    Joined:
    Aug 21, 2018
    Posts:
    57
    Hi, I sent you a mail with a sample project.
     
  22. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Please read the Best Practices documentation to learn about the best practices for using GPUI that will help you get better performance. Especially the first section.
    GPUI does indirect GPU instancing which does not show the tris count on the Statistics window (CPU does not know how many instances are being rendered on the GPU). It does not mean that the triangle count is lowered.
    It is also recommended to read the Terminology page to learn about GPU instancing and its differences compared to various other batching techniques. It can help you make better choices for optimization.
    Please also take a look at the F.A.Q. page which explains various limitations and gives troubleshooting tips.
     
  23. chrpetry

    chrpetry

    Joined:
    Mar 7, 2018
    Posts:
    65
    Hello,
    I just bought your Asset but I can't get it to work.
    Watching your tutorial about runtime generated gameObjects somehow gave me a good start:

    Code (CSharp):
    1.  
    2. GPUInstancerAPI.DefineGameObjectAsPrefabPrototypeAtRuntime(_gpuInstancerManager, prefabObject);
    3. try
    4. {
    5.       GPUInstancerAPI.InitializeGPUInstancer(_gpuInstancerManager);
    6. }catch (System.Exception ex)
    7. {
    8.        Debug.LogError(ex);
    9. }
    But once Initializing I get an exception on shaders:

    Code (CSharp):
    1. System.ArgumentNullException: Value cannot be null.
    2. Parameter name: shader
    3.   at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader)
    4.   at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00008] in <b0fc6facff52490f8c5788181f70c5cc>:0
    5.   at GPUInstancer.GPUInstancerShaderBindings.GetInstancedMaterial (UnityEngine.Material originalMaterial, System.String extensionCode) [0x000a3
    I found out that this happens on Shader "Standard" (I'm on built-in pipeline).
    Do I need to initialize shaders somehow?
     
  24. schwmm

    schwmm

    Joined:
    Oct 20, 2020
    Posts:
    62
    Hi,
    I got your asset recently and spent the last 2 evenings playing with settings and options. A few things I noticed (URP, Unity 2022.2):
    - Unity does not seem to support LODs for detail prototypes. If I add a prefab via GPUI Detail manager, I cannot paint them, Unity shows an error
    - Tree LOD cross-fading is not working well. If I use custom shaders with the feature enabled, LOD fading does work with GPUI, but not as well as when I disable GPUI and let the Unity Terrain do it itself (some shadows in the leafs seem jumpy, which a manual placed prefab or terrain with GPUI doesn't suffer from).
    - Tree LOD fading of the URP shaders of popular store assets like "Fantasy Adventure Environment" don't work
    - Billboards of some popular store asset trees (e.g. Azure Nature) are not correct (auto created texture maps are jibberish). I understand that this is not part of the asset, but is there any way to remedy this? Can I replace some map with a "screenshot" I make in Blender or similar? How could I render out a normal map? Is there a manual work-flow I could follow?

    Thanks and keep up the good work! I love your tutorials and documentation on the website, it helped me a lot fine-tuning things.
     
    Last edited: May 17, 2023
  25. hehui568350701

    hehui568350701

    Joined:
    May 17, 2023
    Posts:
    5
    When I am using the GPU Instancer plugin, there is a flickering scene on my Android phone. Do you have any restrictions on the Android platform?

    GPU Instancer 1.7.3 Unity 2021.3.0
     
  26. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Please make sure that GPUI is set up for the built-in render pipeline and the packages for the built-in pipeline are imported.
    When you first install GPUI, it checks for the Unity packages installed in the project. If the URP or HDRP package is not present, then it will use the built-in render pipeline. If you have URP or HDRP package installed but you are not using it, it might cause conflicts.
    If this is the case, removing the unused URP or HDRP package and then removing and re-installing GPUI will solve the issue.
    To confirm, you can check the GPUInstancer/Resources/Settings/GPUInstancerSettings asset and see if the Is URP and Is HDRP fields are not enabled. You can also use the Tools->GPU Instancer->Reimport Packages menu item to import GPUI shader packages. You should see "Importing package: StandardShaders v1.7.2" on the Console logs after import.

    Hi there,
    and thank you for the feedback.
    - I just tested adding a prefab with an LOD group (Fern_01_LOD from the demo) in Unity 2022.2.12 URP and painted on the terrain and it seems to work. The issue might be specific to the prefab you are using or caused by another tool. If the issue is still present, you can email us a sample project following this guide and we can investigate.
    - GPUI does not use cross-fading for shadows. You can set the shadow LODs to be the same for lower LODs if the shadow change is too obvious.
    - Custom shaders might have custom LOD fading implementations that are not compatible with GPUI.
    - GPUI billboards are designed for built-in tree shaders (Soft Occlusion, Tree Creator, SpeedTree). But since it can also work for other simple shaders, we did not put a forced limit on it. This does not mean it will work with every shader. You should ask the developer of the shader, if they have a solution for billboards.

    Hi there,
    Please see Known Limitations. Please also make sure to update to the latest GPUI version from Asset Store (currently v1.7.7) and the latest Unity LTS version (currently 2021.3.25) to avoid dealing with already resolved issues.
     
  27. kevinsyang17

    kevinsyang17

    Joined:
    Apr 3, 2018
    Posts:
    37
    Hi, I'm on the standard render pipeline using GPU Instancer for trees. I turned off use original shadow and improved a lot of performance, however the shadow is very weird in that it draws the tree shadows like squares with hard edges and doesn't really shadow the tree how it's supposed to be. Is there a better shadow ability in that it doesn't shadow the vertex animation, however higher quality in shadow details?

    If that's not possible is there a recommended workflow to cull shadows so I can ensure good shadow quality yet maintain details? Right now when I use cull for shadows, the tree is not in my view frustum however the shadow should be, but the shadow gets culled too. And if there is any way to level shadows (near higher quality with vertex animation, further ones are like the current shadow shader without animation)
     
    Last edited: May 23, 2023
  28. MicCode

    MicCode

    Joined:
    Nov 19, 2018
    Posts:
    59
    Unity2022.2.18
    GPU Instancer 1.7.7

    Fail to Build when the project have the "com.unity.entities.graphics": "1.0.0-pre.65" package in HDRP

    To reproduce:
    1. Create a HDRP Core template project
    2. Added "com.unity.entities.graphics": "1.0.0-pre.65" to package manifest.json
    3. Import GPU Instancer 1.7.7
    4. Build for Windows

    Or
    1. Open this project
    https://drive.google.com/file/d/1MVklMQGnzmXWheBMkGeF0muWNH7A0Vxd/view?usp=share_link
    2. Import GPU Instancer 1.7.7
    3. Build for Windows



    Shader error in 'GPUInstancer/FoliageHDRP_GPUI_SG': undeclared identifier 'unity_ObjectToWorld' at Assets/GPUInstancer/Shaders/Include/GPUInstancerSetup.cginc(56) (on d3d11)

    Compiling Subshader: 0, Pass: ShadowCaster, Vertex program with DOTS_INSTANCING_ON PROCEDURAL_INSTANCING_ON _BILLBOARDFACECAMPOS_ON
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_SHADOWCASTER UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADD_PRECOMPUTED_VELOCITY _ALPHATEST_ON _DOUBLESIDED_ON _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN _SURFACE_TYPE_TRANSPARENT _TRANSPARENT_WRITES_MOTION_VEC

    Shader error in 'GPUInstancer/Billboard/BillboardHDRP_GPUI': undeclared identifier 'unity_WorldToObject' at Assets/GPUInstancer/Shaders/Include/GPUIBillboardSGInclude.cginc(16) (on d3d11)

    Compiling Subshader: 0, Pass: ShadowCaster, Vertex program with DOTS_INSTANCING_ON
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_SHADOWCASTER UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: INSTANCING_ON PROCEDURAL_INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADD_PRECOMPUTED_VELOCITY _ALPHATEST_ON _BILLBOARDFACECAMPOS_ON _DOUBLESIDED_ON _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN _SURFACE_TYPE_TRANSPARENT _TRANSPARENT_WRITES_MOTION_VEC

    Shader error in 'GPUInstancer/Billboard/BillboardHDRP_GPUI': undeclared identifier 'unity_ObjectToWorld' at Assets/GPUInstancer/Shaders/Include/GPUInstancerSetup.cginc(56) (on d3d11)

    Compiling Subshader: 0, Pass: ShadowCaster, Vertex program with DOTS_INSTANCING_ON PROCEDURAL_INSTANCING_ON
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_SHADOWCASTER UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADD_PRECOMPUTED_VELOCITY _ALPHATEST_ON _BILLBOARDFACECAMPOS_ON _DOUBLESIDED_ON _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN _SURFACE_TYPE_TRANSPARENT _TRANSPARENT_WRITES_MOTION_VEC

    Error building Player: 3 errors

    Build completed with a result of 'Failed' in 49 seconds (48735 ms)
    4 errors
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()


     
  29. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    When you disable the use original shadow option, GPUI uses a very simple shadow shader which can be found under GPUInstancer/Shaders/ShadowsOnly_GPUI. You can edit this shader if you wish to change its behavior. Otherwise you need to edit the shadow passes within your tree shaders and optionally use different shaders for different LODs (e.g. simpler shaders for higher LODs).
    GPUI does not have a shadow culling system that can possibly calculate shadow bounding boxes in a generic way. There is a shadow culling option that can be used for small objects with short shadows that can be culled with small offsets. However it is not recommended to use this shadow culling option with trees which can have very long shadows depending on the light angles.

    Hi there,
    The issue seems to be caused by Unity compiling shader variants with both DOTS_INSTANCING_ON and PROCEDURAL_INSTANCING_ON keywords. After checking their source code, it looks like they change the unity_ObjectToWorld definition when DOTS_INSTANCING_ON keyword is enabled. Actually these two keywords should never be enabled at the same time. I don't know why Unity decided to add a separate multicompile pragma for DOTS_INSTANCING_ON and also allow variants with other instancing keywords with this keyword.
    For now I came up with a temporary workaround. You can add the attached script to your project which is a shader preprocessor that will strip the shader variants with DOTS_INSTANCING_ON keyword from GPUI shaders. Please note that if the shaders still give errors, they are probably loaded from cache and you can solve this by right clicking and selecting Reimport on the shader files with the error or by deleting the cache entirely.
    If this issue carries on to LTS versions, we will look into it in detail for a (hopefully) permanent solution.
     

    Attached Files:

  30. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Hi
    How to integrate it with Gaia?
     
  31. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    GPUI does not have an integration with Gaia (there was one years ago for an older version of Gaia). You can use the GPUI Managers as described on the Getting Started documentation regardless of which tool you use to set up your scene. However if you use additional tools/features that affect rendering at runtime (e.g. other instancing/culling solutions), they might not work out of the box with GPUI.
     
  32. Erlend1

    Erlend1

    Joined:
    Dec 18, 2019
    Posts:
    22
    Hello,
    I've come back to Unity developing after being busy for a while, and now I can't get any performance boost with GPUI anymore. I'm continuing on an older project that uses Unity 2020.3.12f1.

    gi-lots-of-shadow-casters-low-fps.jpg
    The GPUI Detail Manager seems to work, but it doesn't give any noticeable boost in performance.
    The GPUI Tree Manager didn't seem to do anything.
    And the GPUI Prefab Manager appears to lower the Tris and Verts count significantly, but no apparent boost in performance and the shadow casters count goes up to nearly 1300 for some reason.

    I don't understand this as I got around 40 fps before. Are there any particular settings that I must enable?

    One other thing is that the GPUI Prefab Manager adds scripts to my original prefabs. Is this necessary? When I tried to remove and reimport the asset, I got some missing scripts warnings. And I've had exception errors with the added scripts before (GPU Instancer Prefab and Runtime Handler).

    EDIT: Hm, fps increased when ticking on Enable Runtime Modifications and its corresponding options. It also fixed the shadow caster issue. Any other options I should be aware of? As I didn't see any major performance gain with the Detail Manager, for example.
     
    Last edited: Jun 5, 2023
  33. kevinsyang17

    kevinsyang17

    Joined:
    Apr 3, 2018
    Posts:
    37
    Hey so our project is on URP 12.x, and we made a billboard shader using shader graph (with GPUI setup node). However when we assign a quad mesh and a material containing our billboard shader to GPUIPrefab custom billboard, it doesn't get displayed. When we check use GPUI generated billboard it works, is there something we're missing?

    Btw we are using no gameobject workflow. When we click Show Billboard and it creates the quad preview in scene that one works, but no billboard get displayed in game runtime
     
    Last edited: Jun 10, 2023
  34. BaoBao55

    BaoBao55

    Joined:
    Apr 8, 2016
    Posts:
    13
    The prefabs that are added in GPUI Prefab Manager are flickering on an android phone.
    I use unity 2022.2.12 with URP 14.0.6
    My android phone is using Android 12
    Do you have any suggestions to fix it?
     
  35. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Hi @GurhanH ,
    I've recently started a new project using Unity Terrains and "Coverage Mode". I wanted to ask when you might consider supporting this mode in a future update. Thanks for any news or info you have.
     
  36. Mamoru_Suzuki

    Mamoru_Suzuki

    Joined:
    Nov 8, 2022
    Posts:
    6

    Thanks!
     
  37. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    There might be an issue with the shader setup. When you use the Show Billboard button, it is not rendered with GPUI. You can try adding your custom billboard as an LOD with Mesh Renderer using an LOD Group component instead of using the custom billboard option, to see if it changes anything.
    If it does not help, you can send us a sample package or project following this guide and we can investigate.
    Hi there,
    The flickering might be caused by an incorrect depth texture which results in errors in Occlusion Culling, or there might be buffer limitations on the android device where the shaders can not process all the instances. Please try disabling the Occlusion Culling first, and then reducing the number of instances to see if there is a change.
    Hi there,
    We are not planning to support coverage mode currently. There is work for a new asset where we redesign the core system to overcome various shortcomings which will also include support for coverage mode. However it does not have a release date yet.
     
    backwheelbates likes this.
  38. BaoBao55

    BaoBao55

    Joined:
    Apr 8, 2016
    Posts:
    13
    I already disabled Occlusion Culling and reduced the number of instances but some objects are still flickering.
    It happens with PrefabInstancingDemoMobile scene. Some Asteroids are flickering on android.

    Moreover, when I set the Asteroid Objects in AsteroidGenerator to have only "Asteroid_01_LOD" prefab. There is no Asteroids showing up in the scene.(not even a single one)
     
    Last edited: Jun 15, 2023
  39. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Please make sure you have the correct Graphics API settings following this guide.
    If this does not help, please email us a sample project following this guide and also let us know the brand/model of the devices you used for testing.
     
  40. Xine27

    Xine27

    Joined:
    Feb 20, 2019
    Posts:
    11
    Hi there,

    I've been using GPU Instancer successfully for a little while, but have run into a problem now.

    My game is set up with a menu scene, from which it can load various levels. Each level has the same scene management prefab in it, which the GPU Instancer Prefab Manager is attached to. The GPU Instancer Prefabs have been added to the Prefab Manager in the scene management prefab. I have just created a new level, and I have "registered prefabs" in the new scene from GPU Instancer Prefab Manager. In the editor, it correctly shows the number of prefabs in the scene.

    When I enter playmode and load the new level, however, GPU Instancer is not working. The registered instances show as 0, and instead of having their initialization number, the GPU Instancer Prefabs show "Instancing has not been initialized". When I enter playmode and load the old level, GPU Instancer works without any issues.

    I'm sure I am missing something obvious or am loading something out of order in the new scene, but after hours of searching, I can't figure it out.

    Thanks for any help you can give me.
     
  41. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Unfortunately I can not say what would cause such an issue without debugging it. Please email us a bug report with a sample project following this guide and we can investigate.
     
  42. igrus

    igrus

    Joined:
    Aug 29, 2014
    Posts:
    4
    There is an issue where Lit shaders are not rendered as a whole when Forward+ is set.
    The lit Shader object is rendered like this.
    To see other cases, I confirmed that it was rendered when I changed it to FoliageURP_GPUI_SG, which renders properly, and ran it.
    How can I use GPUI/Lit?

    My project version is 2022.2.17.
    The GPUI version is the latest version 1.7.7.
     

    Attached Files:

  43. Erlend1

    Erlend1

    Joined:
    Dec 18, 2019
    Posts:
    22
    Hello!
    Currently, I have a few questions regarding Crowd Animations. I sent an email yesterday or so, but just checking whether it's fine to ask CA-related questions here too? In the email, I asked about how to get a custom shader (SyntyStudios/Blood) to work with CA, and now I also am curious as to how to create a Crowd Animator with the GPUI Crowd API. Is it possible to remake a whole mechanim animator as a crowd animator, with variables and conditions?
     
  44. Sisay

    Sisay

    Joined:
    Dec 6, 2012
    Posts:
    57
    dynamic resolution causes the problem, camera in debug in gpu instancer sees different vs real camera
     
  45. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    Please email us a bug report with a sample project following this guide so we can investigate.

    Hi there,
    No, there are differences and limitations (mainly Crowd Animator runs on GPU and is stateless). Please check the demo scenes and the Crowd Animator API and see what methods you can use to implement your own solution.
    Hi there,
    Please email us a bug report with a sample project following this guide so we can investigate.
     
  46. mmorsi

    mmorsi

    Joined:
    Oct 14, 2021
    Posts:
    7
    Greetings, I just bought this plugin and installed it on top of the latest Unity LTS release (2022.3.3f1) and immediately encountered an issue where tree billboards are not being generated correctly, specifically the texture area corresponding to the first viewing angle in the atlas is being squashed.

    This is on a stock Unity install with no other dependencies or plugins added besides GPU Instancer:
    - Create new project (Unity 2022.3.3f1)
    - Install GPU Instancer from the Unity Asset Store (Window > Package Manager > My Assets)
    - Open the "TreeInstancingDemo" scene
    - Select the "GPUI Tree Manager" game object
    - Click "Regenerate Billboards"
    - Observe that the first billboard texture is squashed

    See this screenshot for a demonstration of the issue. Creating a new project based on the previous Unity Release (2022.1.5f1) resolves the issue and Billboards are created correctly.

    Thank you in advance for addressing this issue.
     
  47. JulienCornillon

    JulienCornillon

    Joined:
    Nov 17, 2022
    Posts:
    4
    Hello
    We run into an issue using GPUInstancer Prefab Manager v1.7.7.
    We are on Unity 2022.3.4f1 using URP 14.0.8 in deferred rendering mode.
    Every point light on the scene add a ton of shadow casters and make high number of drawcalls (add ~1750 shadow casters)
    We are using GPUInstancer for a long time and we are pretty happy with it but we added the torch and light not long ago and then run into this issue.
    As soon as we disable the prefab manager it remove all the shadow cast, we tried to remove all prefab instance from GPU Instancer and don't use it and without it we don't have the issue but it inscrease our regular draw calls.
    It seems even object culled from the LOD at the other side of the map cast some shadow when using our point light.
    In our project we only use the prefab manager and the detail manager, for the detail (grass) we don't have any issue it work fine.
    Prefabs inside the gpu instancer prefab manager are added/removed in runtime because we instantiate/destroy prefabs as we move in the world. This is why some of the prefabs appears at 0 because they spawn inside other biomes.
    Here is a video.
    In the video the torch is the only light source active in the entire scene.
    I've attached screenshots of our render pipeline settings.

    I'm available if you need more information about our issue.
    Thanks for your time.
     

    Attached Files:

  48. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
    Hi there,
    I am using Unity 2022.3.4f1 and when I bake my nav mesh (with the AI Navigation-Obsolete) my trees placed via GPUI Tree Manager are not showing in my build.

    I would very much appreciate if anyone knows how to fix that!
     
  49. GurhanH

    GurhanH

    Joined:
    Apr 24, 2017
    Posts:
    533
    Hi there,
    I have tested the billboards on 2022.3.4 and it seems to work fine. There might have been a Unity bug for textures on 2022.3.3. Please upgrade to the latest LTS and see if it solves the issue.

    Hi there,
    Please email us a bug report with a sample project following this guide so we can investigate.
     
  50. kspeeder

    kspeeder

    Joined:
    Apr 9, 2018
    Posts:
    5
    hello, when i add the manager following the quick start guide, the whole view turns black, terrain sky box game objects everything. why is this happening?

    gpuiissue.jpg