I have been experimenting with different ways of reducing draw calls on VFX graphs to make them more performant on mobile (Quest 2 specifically). Is there a “correct” way of doing it?
For example, outputting multiple quads like this is really bad Especially when this is the graph for a button, of which there are many.
The plan is to have a single VFX graph that outputs all the buttons in the scene, atlas the textures, make this all use a single flipbook output and set the page index and other varying parameters with a GraphicsBuffer. Is this really the best option?
I already tried GraphicsBuffer with projectiles and it seems to work.
Buttons from VFX? You mean like UI buttons?
Usage aside, in current version having single VFX for all effects is most likely the best solution, however if you need to spawn single particle (maybe more?) with some initial values you could use direct link in some cases.
// edit: still, interesting idea, does it actually work? How do you handle interaction? If you need ui on top of things then you would need camera stack or something, because particles are not compatibile with UI, but if you already have this you could make whatever else you want.
Hi! At the moment, there’s no auto batching in VFX Graph.
VFX Instancing is currently being worked on for 2022.2. This feature won’t batch different outputs within the same VFX asset but will be able to batch instances (== components) of the same VFX asset within a single drawcall (still it will be one drawcall per output). So for instance, 3 outputs within a single VFX asset that is being used by 20 components in the scene will result in 3 draw calls (of course there’s the constraint of ordering of transparents that may break batches). So the drawcalls will be optimal with respect to correct rendering.
So at the moment you have to be explicit about batching. using events and/or graphics buffer. One example of explicit batching is described in this (rather old) blogpost. We’re also using a similar technique for sparks in the spaceship demo. One 2022.2 feature that may ease explicit batching (among other things like particle state machines…) is boolean ports to enable/disable blocks, to simulating/render different types of particles within the same system. Another thing in our backlog that can be thought of is single output for multiple systems (we have multiple outputs for single system but not the other way round yet).
Sorry I wasn’t clear. I meant that in addition to allow mixing particle types in a single simulation, boolean ports can allow to implement some states per particle in an easier way. Especially if coupled with some custom int attribute “state” and with subgraphs for instance.