#How to disable GPU Instancing?

1 messages · Page 1 of 1 (latest)

buoyant bramble
sleek girder
#

I'm pretty sure you'd have to remove #pragma multi_compile_instancing from the shader. "multi_compile" implies that it's always going to compile the variants that support GPU instancing, whether or not any materials actually use it

swift marsh
#

The docs page is about draw call optimization, so I think in that context it's enough to uncheck it on the materials, so that the instanced variant is not used.

sleek girder
#

it says that you should disable it to reduce your variant count

swift marsh
#

I think this is just poor wording. If you follow the link to the gpu instancing page and the the "enabling" page, it says:

To enable GPU instancing for a prebuilt materials, follow these steps:

Select the material in the Project window.
In the Advanced Options section of the Inspector
 window, enable Enable GPU Instancing.
Note: If you use the Universal Render Pipeline
 (URP) or High Definition Render Pipeline (HDRP), the recommended best practice is to use the SRP Batcher instead, which is enabled by default. GPU instancing works only if you disable the SRP Batcher.

Nothing about variants.
Anyways, the question has been answered regardless of which one they meant:

  • To prevent gpu instancing variants from being used, just uncheck the gpu instancing check on the material.
  • To prevent the variants from compiling entirely, use custom shaders that don't support gpu instancing, or modified versions of the standard shaders.
random flicker