1
\$\begingroup\$

Please could somebody advise on whether it is possible to control the culling of particle systems in Unity? I am referring to the entire system, not individual particles.

In my use-case, I am modifying the vertex transformation to get the "distant object effect".

When the camera thinks it is not viewing something it will cull it (frustum culling). For most game objects you can get around this by inflating the size of the bounds to make the camera think it is within its frustum and therefore not get culled. However, particle systems are not a single object, they are many particles and I can’t see a way of manipulating the total bounds of the system.

Any ideas?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ make the frustum bigger? Why would you want particles outside your viewrange to be rendered? \$\endgroup\$
    – dot_Sp0T
    Oct 22, 2020 at 18:35
  • \$\begingroup\$ in his linked question, you can see why. \$\endgroup\$
    – Millard
    Oct 22, 2020 at 19:49

1 Answer 1

1
\$\begingroup\$

I found an answer in the Unity forums, which is: no it's not possible, at least not in Unity 2019.
One thing you could do is force the bounds to be larger by adding 2 particles, one in each corner at a very large value.
To do this, you can call Emit on your system to generate a particle with an infinite lifetime at an extreme position. For example, emit one at 10000, 10000, 10000 and the other at -10000, -10000, -10000.

\$\endgroup\$
1
  • \$\begingroup\$ As an alternative, you could change the shader I gave you to not use the position of the object to construct the transformation. Instead, pass in a pre-cooked matrix from a script (probably more efficient that way too). Now you can position your object anywhere you want, like parenting it to your main camera so it's always in-frustum. ;) \$\endgroup\$
    – DMGregory
    Oct 30, 2020 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .