[RELEASED] GPU Instancer

Hi,
We will add lower level APIs, like rendering objects with given transform data list. However sending transform updates every frame in large scales to the GPU is not ideal.
We are also planning to provide an API to add custom Compute Shaders, so that you can also make simple transform updates in GPU instead of CPU.

Yes, I agree :slight_smile: Will be done in a future update.

1 Like

Hi everyone,

We have just uploaded a series of tutorials showing the basics of using GPU Instancer.

You can watch them on YouTube :eyes: Tutorial Videos Playlist

3 Likes

So with post processing added to the camera can you add a video of how your plugin delivers frames per second?

Hi there,

I have just added another video showcasing GPU Instancer performance with post processing. You can check it out at this link.

3 Likes

Hello, when you first release this video i already took a look at it instantly. :slight_smile: Thanks for filling my request.

1 Like

Will this work with touch bending? for example a grass that bends when hit by the players collider?

Hi,

Our foliage shader currently doesn’t have that feature, but we will add support for this in a future update.

However, since you can use custom foliage shaders with GPU Instancer, you can use a touch-bending shader if you have one as well (assuming that shader works with world positions for its player position calculations).

1 Like

Nice to hear !

Another thing Im planning to use:
fading out objects when they get very close to the camera. ( shader alpha )
Is that possible with instancing?

Sure thing. Whatever custom surface shader you use on your prefabs will be auto-converted to work with GPU Instancer. So with your shader, the way your objects fade out with instancing would look exactly the same as without.

1 Like

hmm,
i was quite curious about how you handled things especially regarding detail rendering on the terrain.
after having looked into your detail demo though i was quite disappointed: having untiy rendering a vast amount of detail patches of approx. 1x1m size is not really comparative.

Hi there,

Thank you for your comment. In the DetailInstancingDemo scene, GPU Instancer is rendering the same amount of grass as Unity terrain does. GPU Instancer also uses a more complex shader, adds shadows and makes cross-quad meshes depending on the settings you use. Can you please explain why do you think it is not comparative? Which terrain settings would you like to see?

hi there,
it was a little bit late when i looked into the demo. too late actually to write a relevant comment on your asset.
i will have a deeper look into it and come back to you later.
thanks

My second requests will be to add mobile support open gl 2 and 3. Is this even possible ?

Hi,
It is not possible to use GPU Instancer with OpenGL 2 or 3.

ok, but your availability feature says its support OpenGL Core 4.1+/ES3.0+ on Windows, macOS, Linux, iOS and Android??

Hi there!

Yes, GPU instancing works for ES 3.0. But to dispell any possible cofusuion: the problem here is that, since GPU Instancer makes extensive use of compute shaders, the requirement for android devices is at least the Vulkan API or OpenGL ES 3.1. We have actually tested with modern android devices (with Vulkan on Galaxy S8 and S9+) and saw good results; however, other than these, we haven’t tested extensively on mobile.

1 Like

@LouskRad Hi there, this looks awesome. Can´t wait to try this but I have a couple questions:

  • Would this work with the LWRP (lightweight render pipeline) shaders out of the box? Or do I have to manually modify my shaders and include the “GPUInstancerInclude.cginc” as mentioned here ?
  • What would be the best approach when my project has multiple loaded scenes in additive mode? Can there be multiple GPU Instancer managers?
  • It would be a great time saver if the GPU Instancer Manager had an “auto-detect prefabs on scene” button.

Cheers,
Juan

Hi there, and thanks.

Currently GPU Instancer does not convert SRP shaders automatically. If you need to use GPU Instancer with SRP, you need to modify your lightweight shaders manually by including the “GPUInstancerInclude.cginc”, here is how:

HLSLPROGRAM

...

//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma instancing_options procedural:setupGPUI

...

#include "LWRP/ShaderLibrary/InputSurfacePBR.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl"
#include "Include/GPUInstancerInclude.cginc"
ENDHLSL

You can add as many managers to your scene(s) as you like. They will work additively as well. For best performance, you could be careful not to have the same prototype in multiple managers. Note that you can activate and destroy managers anytime you like.

Well, if you mean auto-detecting the prefab instances in the scene, GPU Instancer already does that when you click the “Register Prefabs in Scene” button (or the first time you add a prototype). If you mean adding all the game objects in your scene that have prefab definitions (in order to define them as prototypes), we could add this in a future update where you could select the prefabs in your scene from a menu to import them as prototypes.

1 Like

Hi, I’m very interested in this asset, but I got a question:
Does this asset contain a colliders pooling system? (Only enable or create object’s colliders which is close to camera)
For if every object in the scene has a collider, it will be very costy even if all the rendering are GPU instanced.