Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fluid rendering performance
#2
Hi there,

From within a URP Renderer feature there's no way to access scene objects, other than use FindObjectsOfType() or filter by layer/tag. The reason for this is that renderer features are project assets, and as such, they're not tied to any scene in particular and so they can't hold references to GameObjects. I know this is less than ideal, but it's what URP is Triste. This makes it impossible to provide direct references to objects like you can when using command buffers in the built-in pipeline, which would remove any need to do scene-wide searches at runtime.

A workaround in case you don't add/remove particle renderers programmatically, is to cache the particleRenderers array as a member variable and only call FindObjectsOfType() is it's null:

Code:
if (particleRenderers == null)
particleRenderers = GameObject.FindObjectsOfType<ObiParticleRenderer>();

(02-02-2021, 02:16 PM)jleemans Wrote: Any way to improve that ? Usage of frustum culling maybe ?[/font][/size][/color]
Frustum culling won't help in this case, since we still need to have access to the particle renderer from the renderer feature anyway.

Let me know if this helps.

kind regards,
Reply


Messages In This Thread
Fluid rendering performance - by jleemans - 02-02-2021, 02:16 PM
RE: Fluid rendering performance - by josemendez - 02-02-2021, 02:40 PM
RE: Fluid rendering performance - by jleemans - 02-02-2021, 03:08 PM