Search Unity

[RELEASED] GPU Instancer

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

  1. Alex3333

    Alex3333

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

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    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 ;)
     
    Lars-Steenhoff likes this.
  3. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    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:
    904
    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:
    904
    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:
    904
    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:
    904
    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:
    904
    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:
    647
    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:
    119
    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:
    41
    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. Danistmein

    Danistmein

    Joined:
    Nov 15, 2018
    Posts:
    82
    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,913
    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:
    429
    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:
    429
    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:
    119
    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:
    236
    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,913
    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:
    365
    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:
    904
    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:
    904
    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:
    904
    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:
    26
    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:
    12
    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. Ikarus_Project_V

    Ikarus_Project_V

    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:
    904
    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:
    904
    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:
    904
    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:
    12
    Hmmm... How do i do it?
    SNAG-0009.png
     
  30. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    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:
    54
    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:
    904
    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:
    904
    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:
    904
    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:
    3,527
    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:
    26
    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:
    54
    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:
    103
    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
     
  39. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    Basically any shader that bends the grass by modifying vertex positions from a global world position parameter would work. The example project mentioned by @h00man does not work because the shader itself has a dependency to the Terrain Engine, so it is the shader that is not working there and not the grass bending solution it comes with.

    It is also possible to add grass bending functionality to GPUI's Foliage shader, and we will look into adding this in the future.
     
    Lars-Steenhoff likes this.
  40. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    We did not see these issues in our tests. For the PrefabInstancingDemo, it is possible that your prototype settings have changed. For both cases, do you see any errors/warnings in the console window? Also, which Unity version are you using?
     
  41. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    103
    Thank you for this information.
    I solved (DeInstancingSphere layer and for the wind lesser values for the wind vector).
    Thanks again for integrating events with parameters.

    Regards
     
    LouskRad likes this.
  42. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    Is there a reason why the prefab assets (those in PrototypeData) are saved so often on disk ? They are re-saved when the scene is saved but also when some others addons are saving things, for example there is a bad interaction between GPUI and xNode and GPUI is constantly saving things when working with xNode.
     
  43. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    GPUI serializes the prototype settings into ScriptableObjects that are saved as assets under PrototypeData. Any time the prototype settings change, the ScriptableObjects would be updated on disk.

    Depending on your usage, xNode might be modifying your prototype data. You can compare the files with a text editor before and after using xNode to see what is changing.
     
  44. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Are you sure this has something to do with GPUI? xnode by default auto saves a lot. That can be changed in the preferences.
     
    LouskRad and hjohnsen like this.
  45. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    79
    Hi -- I still have this same issue. I recently updated to the most recent GPUInstancer.

    The problem is that if I render to a camera that is disabled, then the instanced geometry won't be picked up.
    In order to get around this, I have to render in a coroutine where first I enable the camera, then I wait until the end of the frame, and then I render the camera. It's not enough to enable the camera, I have to also wait. After taking the capture, I can then disable the camera again.

    I'm doing it this way because I have screenshotter cameras which should not be active during the application run.

    Is this something I can fix by manually calling some code, or is it a limitation with how Unity works that it's not possible to get around?
     
  46. LouskRad

    LouskRad

    Joined:
    Feb 18, 2014
    Posts:
    904
    The issue there seems to be that Unity's DrawMeshInstacedIndirect draw calls do not register on disabled cameras. The reason for waiting a frame is because when you enable the camera, GPUI makes the drawcall on the next LateUpdate. You can instead call the LateUpdate() method of the manager you are using to force the drawcall on the current frame.
     
    mikerz1985 likes this.
  47. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    I'm using Unity version 2019.3.0a3 Personal.
    I think it's a beta version.
     
  48. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    @LouskRad, Hi, I just Purchased this, I was hoping I can improve my FPS in my RTS game. I tried to use this on my infantry and I got this error:

    Please help

     
  49. AlanRStagner

    AlanRStagner

    Joined:
    Jan 9, 2018
    Posts:
    11
    Hi, I've just purchased this for a VR game I'm working on. I'm trying to use this with the Universal Render Pipeline and the foliage shaders in Lux LWRP Essentials.

    It seems like GPUI has a tough time with the nature shaders in Lux LWRP however. My trees are not showing up at all. I *can* switch them over to the Lit Extended shader in that same package and those work fine, and additionally if I apply the shaders GPUI generated (GPUInstancer/Lux LWRP/Nature/Tree Creator Bark Optimized) manually to a cube in the scene, the shader does appear to work on that cube, but manually applied the same auto-generated materials to the trees doesn't work either.

    Any ideas?
     
  50. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    146
    In the editor my grass is missing a material after i paint it. if i simulate it or press play/build it renders normally. trees work just fine. the grass works, its just difficult to paint and design in the editor if its showing up pink like it is and having to simulate/press play to see changes. is there a way to fix this?"

    i am using unity 2019.2.1 and hdrp 6.9
     

    Attached Files:

    Last edited: Nov 26, 2019