Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] GPU Instancer

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

  1. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    339
    The same thing is with me. Only with prefab manager.
     
  2. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    320
    Hello is your GPU instancer supports smooth change from last LOD to billboard, also beetween billboards angle, I use vegetation studio but I want to change it for some system that support smooth billboard change (cause vegetation studio isnt) let me know ;)
     
  3. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there, and thank you for the feedback.

    We have investigated this issue on HDRP 6.9.0 and were able to replicate the issue. It looks like the problem is with depth / motion vector calculations done by the Amplify Impostor HDRP shaders when used with GPUI.

    We have modified the shader source to disable the AlphaToCoverage feature all together but it looks like that is not the only issue in HDRP when the shader is used with indirect instancing. In the Standard pipeline it is possible to solve issues that are based on depth / motion vector usage by using a custom shader for these instead of the built in one, but Unity did not provide this option for HDRP so far.

    We are not familiar with Amplify's impostor shaders enough to recommend any solution that is based on modifying their OctahedronImposterHDRP shader or comment on the specific issue that is causing this in that shader. However it looks like some features of this shader is not compatible with indirect instancing in HDRP.
     
  4. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    GPUI needs support for compute shaders and indirect instancing to run. If the target platform does not support these, it is not possible to run GPUI on that platform.

    If your target platform supports these, you can take a look at this wiki page for information on the correct build settings.
     
  5. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there, and thank you for the video.

    It might be the case that the mesh renderers on the game objects can be enabled by a script in your project after GPUI disables them. This would result in them being rendered twice - once with GPUI and once with Unity mesh renderers.
     
  6. LouskRad

    LouskRad

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

    Can you please contact us from the support email with the specifics of your intended usage on Oculus Quest?
     
  7. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Thank you for the feedback.
    The issue there is with the nature of threaded programming. We will look into providing better explanation on this feature and error logs in such cases where a third party script intervenes with GPUI's threaded initialization.
     
  8. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there.

    GPUI supports cross-fading between LOD levels when your shader supports it. Smooth transitions between billboard angles are not supported for automatically generated billboards, but you can define a custom billboard for this purpose (such as an Amplify Imposter) that does smooth transitions and use it instead of the generated one.
     
  9. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    320
    Ok but what with smooth change beetwen las LOD and billboard because thats what I'm looking for ;)
     
  10. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    48
    Thank you, I reported the issue to the Amplify team. My knowledge of shader programming is very limited, could you explain how you disabled the AlphaToCoverage part?
     
  11. hellstorm

    hellstorm

    Joined:
    Jun 29, 2015
    Posts:
    17
    Greetings!


    using Gpu instancer with multiple scenes, the culling in my second level starts flashing and flickering.

    i have terrains in both the first level and the second, both with terrain grass drawn via gpu instancer.

    if i build it so that level 2 is the first loaded level the culling in that level does not flash.

    im using load level async, is there something carrying over? should i load a empty scene inbetween?


    this only appears to happen in the build, not in the editor. ( load level async doesnt work in editor)


    and using load level works fine, is there extra steps for aysnc loading + gpu instancer in multiple levels?



    EDIT


    It was finding the wrong camera even tho i dragged in my specific one, i had to un tag the OVR camera left and right eyes as i was using center eye anchor, all were tagged as main camera, and sometimes it would pick the disabled ones over the center
     
    Last edited: Oct 26, 2019
  12. wechat_os_Qy0_X1ITy6VrZHYPJFd58JGlA

    wechat_os_Qy0_X1ITy6VrZHYPJFd58JGlA

    Joined:
    Nov 15, 2018
    Posts:
    58
    Hello.

    I get this error when I switch to a scene that contains the GPU Instance in runtime. Any ideas?

    NullReferenceException: Object reference not set to an instance of an object
    GPUInstancer.GPUInstancerUtility.AddDetailInstanceRuntimeDataToList (System.Collections.Generic.List`1[T] runtimeDataList, System.Collections.Generic.List`1[T] detailPrototypes, GPUInstancer.GPUInstancerTerrainSettings terrainSettings, System.Int32 detailLayer) (at Assets/GPUInstancer/Scripts/Core/Static/GPUInstancerUtility.cs:929)
    GPUInstancer.GPUInstancerDetailManager.InitializeRuntimeDataAndBuffers (System.Boolean forceNew) (at Assets/GPUInstancer/Scripts/GPUInstancerDetailManager.cs:134)
    GPUInstancer.GPUInstancerManager.OnEnable () (at Assets/GPUInstancer/Scripts/Core/Contract/GPUInstancerManager.cs:202)
     
    Alex3333 likes this.
  13. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,370
    It would be good to be able to disable the noise map for grass in the Map Magic integration. Or make it procedural with a slider.

    Also, the Map Magic integration error message should be changed to read "Map Magic is not present - make sure to add MAPMAGIC to your Scripting Define Symbols in Settings > Player".
     
    Last edited: Oct 25, 2019
  14. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    305
    Is there a way to slightly increase the culling frustrum? On a desktop VR build, I'm noticing vegetation details not rendering on the very edge of my field of view. It's like it needs an additional margin setting so that there's room for error in your peripheral vision.
     
  15. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    305
    Sorry, I'm just being stupid (although I did look for it on the docs website but my search didn't turn up anything)... found it: 'Frustrum Offset' under Culling, for each prototype. Somehow I expected it as a global setting, but makes sense to have it per instance (and I really love you multi-select functionality!)
     
    LouskRad likes this.
  16. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    48
    Yes, the UX of the asset is really nice.

    I think I figured out how to disable the Alpha to coverage, but indeed there are more issues with the shader.
     
    LouskRad likes this.
  17. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    229
    I just purchased GPU Instancer and have found an editor layout issue in 'GPU Instance Tree Manager - Scene Settings'.
    'Min Culling Distance' and 'Use Floating Origin' overlay each other. I know how to fix it but the problem exists in the product source itself.
     
  18. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,370
    Anyone know the best practice to regenerate detail grass for when they are changed from an options menu?

    The key to regenerating is InitializeRuntimeDataAndBuffers(forceNew: true), but when changing the "terrainSettings.maxDetailDistance" it starts drawing the grass in chunks/squares, instead of in a circle one grass at a time.

    Is there another function to call to update this?
     
  19. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    339
    Hello,

    I am just starting to dive into GPUI and have a question.
    What is prefab.prefabPrototype? I can't find anything on it in searches.

    I am very excited about digging in!

    Thank you,
    Boysenberry
     
  20. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there,
    This looks like a setup issue. If you can send us a sample that shows this so can investigate it.
     
  21. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there.

    Which Unity version are you using? We have seen this before in a Alpha Unity version, but GPUI officially does not support alpha and beta builds.
     
  22. LouskRad

    LouskRad

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

    When you add a prefab to a manager, GPUI registers it as a prototype. The instances of this prefab are then rendered by GPUI. As a term, a prefab prototype is used for the scriptable object GPUI uses to hold settings data for the prefab (e.g. culling, shadow, lod etc.).
     
  23. jebediahh

    jebediahh

    Joined:
    Feb 20, 2017
    Posts:
    22
    Hello - I am using Nature Manufacturer's Meadow Environment - grass prefabs for terrain. I'm using mapmagic also and the GPUI integration. I can get it to place the grass and it is working in runtime except that the draw distance is capped at 50 no matter if I change the max detail setting. However, if I use a grass billboard, then the draw distance does not get capped.. the max detail distance setting works in that case. Do you know how I can increase the draw distance when using grass prefabs? Is it just these particular prefabs that cause this?
     
  24. Anti-Ded

    Anti-Ded

    Joined:
    Oct 21, 2017
    Posts:
    10
    Hello. After game build emission is gone. Why?
    In editor SNAG-0003.png
    In game SNAG-0004.png
    GPU Instancer Prefab Manager SNAG-0005.png
     
    Alex3333 likes this.
  25. Jannicke_Viktor

    Jannicke_Viktor

    Joined:
    Feb 23, 2019
    Posts:
    1
    Hi,
    I have just a little Question.
    Are you going to expand the Gaia Integration to Gaia Pro?
     
  26. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Hi there,
    Meadow Environment shaders have a built in parameter that overrides the GPUI distance culling. You can see this wiki link for details:

    https://wiki.gurbu.com/index.php?title=GPU_Instancer:FAQ#Nature_Manufacture_-_Meadow_Environment
     
  27. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    It looks like the emission is coming from a shader variant that doesn't enter the built. It should fix the issue if you change the material to use the generated shader with the _GPUI suffix.

    For example if your shader is /MyShaders/MyEmissiveShader, there should be a shader in your project that is /GPUInstancer/MyShaders/MyEmissiveShader.
     
  28. LouskRad

    LouskRad

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

    the Gaia Integration basically adds the GPUI tools to the GX menu. You can use these tools under the /Tools/GPU Instancer menu for the same effect, and these should also work with Gaia Pro.
     
  29. Anti-Ded

    Anti-Ded

    Joined:
    Oct 21, 2017
    Posts:
    10
    Hmmm... How do i do it?
    SNAG-0009.png
     
  30. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    186
    Any chance you have tested your GPUI Anim. for similar HDRP setup? Or are you able to sometime this year? I purchased the GPUI long time ago, and I like that it still supports back to 5.X. I am getting ready to play with HDRP again, and since your solution seems to be the only real way now, aside from Unity tilesets (hard) to do good veg. in HDRP (performance good+) I find myself considering just doing things your way - but wanted to check if Anim asset was HDRP tested yet?

    Also have you considered playing with getting a add-on working for the new Motion Matching - would be so sick!
     
  31. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    51
    hi,
    there is a free project on GitHub and it's a grass shader which bends and interacts with character movements .
    here is the project :
    https://github.com/Elringus/GrassBending#package


    so i've been trying to convert the grass shader for gpu instancer and i'm getting this error.

    Shader error in 'GPUInstancer/Hidden/TerrainEngine/Details/BillboardWavingDoublePass': unrecognized identifier 'UNITY_VERTEX_INPUT_INSTANCE_ID' at /unity/2019.1/Unity/Editor/Data/CGIncludes/TerrainEngine.cginc(37) (on d3d11)
    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR


    and here is the grass shader:
     

    Attached Files:

  32. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    you can change the shader of a material from here:

    upload_2019-11-12_14-5-28.png

    In this case, you can try using the GPUInstancer/VacuumShaders... version of this shader.
     
  33. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    599
    Crowd Animations works in HDRP, however currently there is no included HDRP shader in the package. We are looking into adding one in the near future.

    Also, thank you for the feedback. We will look into integrations for CA after the 1.0 version, but we will keep Motion Matching in mind as well.
     
  34. LouskRad

    LouskRad

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

    We've investigated this project and saw that the shader is not a contained, stand alone shader. It overrides the Unity Terrain's shader for billboard grass but still depends on the Unity Terrain for its shader parameters. On the other hand, when you use GPUI the Unity Terrain's grass rendering features are disabled and GPUI renders your grass instead - meaning the required parameters for this shader will not be available.

    In short, this shader would not work with GPUI.
     
  35. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,233
    Is there a touch bend shader that is known to work ?
    I'm also looking for something that makes the grass and vegetation interactive
     
  36. jebediahh

    jebediahh

    Joined:
    Feb 20, 2017
    Posts:
    22
    Does this asset provide functionality similar to vegetation studio when it comes to run time management of vegetation? Which performs better and what are the trade offs (assuming that the 2 assets are even comparable)?
     
  37. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    51
    ok thanks man... so do you know any interactable grass or foliage shader that is compatible with cpu instancer?(any project on github or any asset on the assetsore)
    cuz i really need that bending feature for my grass and foliage
     
    Lars-Steenhoff likes this.
  38. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    15
    Hi,

    I'm doing some basic tests with the last update 1.2.6, report something that doesn't work as it should:
    PrefabInstancingDemo - Asteroids remain stationary after being hit by the spacecraft.
    AddModifyTerrainsRuntimeDemo - after changing Mesh Setting from Billboard to Cross Quads, only the last instance is replaced and the rest is deleted, after pressing Re-Initialize GPU Instancer Wind Waves becomes superfast and uncontrollable.

    Thanks
    Regards