Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Get skinned mesh's previous frame vertex position in Shader

Discussion in 'Shaders' started by jjiangweilan, Apr 22, 2021.

  1. jjiangweilan

    jjiangweilan

    Joined:
    Mar 31, 2018
    Posts:
    19
    Hi all, our team needs to generate motion vector in UV space for skinned mesh renderer, but we can't successfully get the previous frame's vertex position in shader.

    We are using SRP in Unity 2018.4. When we draw the motion vector, we set
    RendererConfiguration
    to
    PerObjectMotionVectors
    . However, the previous frame's vertices are not set in TEXCOORD4 and there is document about how we can use PerObjectMotionVectors.
     
  2. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    You ever figure this out? I'm having the same issue TEXCOORD4 isn't set to anything valid in a custom SRP.
    Unity 2020.3.11
     
  3. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
  4. jjiangweilan

    jjiangweilan

    Joined:
    Mar 31, 2018
    Posts:
    19
    We asked Unity support, their answer is Unity 2018 SRP doesn't support skinned mesh motion vector (even tho there is a button clearly saying skinnedMotionVectors in SkinnedMeshRenderer component, sucks)

    We opt in developing our own SkinnedMesh using Compute Shader and do all thing in GPU side