Jamez0r

Just a quick question - does an empty PartsRenderer "do anything"?

We are configuring a lot of objects that the player can attack and break them. Each of the objects use a Skeleton Render Separator, and has a PartsRenderer that is set to be layered underneath the characters. When the player attacks the object and breaks it, some of the Slots are moved into that PartsRenderer (the pieces of the object that fall to the ground).

We might have a lot of these breakable things in a scene at a time, so I just wanted to double check and make sure that having the empty PartsRenderer on each of these breakables (before they are broken) wouldn't have any significant impact on cpu/gpu.

Thanks :) :)

Edit - Just to clarify a bit more, I'm curious if the Mesh Renderer component on the PartsRenderer is still "rendering" (taking any cpu/gpu) even without any Slots on that PartsRenderer. If so, I could set something up that would completely disable the PartsRenderer until it is needed.

Edit 2: Just remembered another quick question I had. Does an animation with 0 alpha take cpu? :detective:
Аватара пользователя
Jamez0r
  • Сообщения: 259

Harald

Jamez0r писал(а): I'm curious if the Mesh Renderer component on the PartsRenderer is still "rendering" (taking any cpu/gpu) even without any Slots on that PartsRenderer. If so, I could set something up that would completely disable the PartsRenderer until it is needed.
If no slots are active, then the mesh will be set to have 0 vertices. I'm quite sure that Unity will not issue an empty draw call, so the rendering part should not be a problem.
Jamez0r писал(а):Edit 2: Just remembered another quick question I had. Does an animation with 0 alpha take cpu?
Yes, it will perform the full update of both the animations and of mesh generation. Theoretically you could use your own custom shader that passes down information via the alpha channel of the skeleton vertices and don't want to use it as transparency but for something else, e.g. to blend between two textures.

If you want to disable rendering, you might want to do this explicitly via code.
Note that you may still want to perform animation updates to keep the animation timing going, like with offscreen skeletons.
Аватара пользователя
Harald

Harri
  • Сообщения: 2761

Jamez0r

Thanks for the info!
Harald писал(а):
Jamez0r писал(а):
Jamez0r писал(а):Edit 2: Just remembered another quick question I had. Does an animation with 0 alpha take cpu?
Yes, it will perform the full update of both the animations and of mesh generation. Theoretically you could use your own custom shader that passes down information via the alpha channel of the skeleton vertices and don't want to use it as transparency but for something else, e.g. to blend between two textures.

If you want to disable rendering, you might want to do this explicitly via code.
Note that you may still want to perform animation updates to keep the animation timing going, like with offscreen skeletons.
I worded this question very poorly/ambiguously, sorry about that! I have lots of environment plants/etc that blow in the wind. So I have a basic "idle" animation on Track 0, and then a special "wind_breeze" animation on Track 1. The alpha (for the TrackEntry) for the "wind_breeze" animation changes based on whether or not there is a breeze coming through, so if there is no breeze then the alpha is 0. I'm wondering if that "wind_breeze" animation, when it has a track-alpha of 0, is still processed or just skipped over?

Thanks as always :nerd: :nerd:
Аватара пользователя
Jamez0r
  • Сообщения: 259

Harald

Oh, you meant track alpha. :) Actually the track is currently still processed (applied) when track alpha is 0.
Аватара пользователя
Harald

Harri
  • Сообщения: 2761

Jamez0r

Harald писал(а):Oh, you meant track alpha. :) Actually the track is currently still processed (applied) when track alpha is 0.
Ok cool, I'll take that into account!
Аватара пользователя
Jamez0r
  • Сообщения: 259

Harald

:)
Аватара пользователя
Harald

Harri
  • Сообщения: 2761


Вернуться в Unity