Search Unity

Best practices for render of animated character to texture in given pose?

Discussion in 'Animation' started by Andrew_Howe, May 8, 2018.

  1. Andrew_Howe

    Andrew_Howe

    Joined:
    Sep 22, 2015
    Posts:
    5
    Hi, posting for a colleague. He is setting up the animation pose of a human character and rendering it to a texture. The chief problem is that it seems that the animation pose is not used; the character is rendering in its initial default pose.

    Clearly this is something to do with update order. If the render-to-texture is deferred until the next frame, the correct pose is rendered. However, deferring the render until LateUpdate() doesn't seem to help. According to the animation update diagram, it ought to help I think? But now I'm thinking about it maybe we need to somehow force an update on the animated thing - but how? Can you just call Update() on it?

    Additionally, the latency is currently high. I can imagine four scenarios:
    1) The animation is updated, the rendering is done, and the resulting texture can be used in the rendering of the current scene in the same frame (latency 0)
    2) The animation is updated, but the rendering isn't ready until the next frame (latency 1)
    3) The animation is not updated, so rendering must be deferred until the next frame, but we can use it on that frame (latency 1)
    4) [I believe we're here] Both problems (latency 2)

    We'd really like to be at 1). Is that achievable?