Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Ray tracing shader skeleton transforms not properly updating when not rendered rasterized

Discussion in 'General Graphics' started by Yacker, Oct 2, 2023.

  1. Yacker

    Yacker

    Joined:
    Oct 24, 2018
    Posts:
    33
    So, I have a game set up where I want to have two rendering modes: a rasterized mode and a ray traced mode. I achieve the ray traced mode with a script that executes a ray trace shader, and a bunch of custom shaders (that also have their own code for rasterized mode, obviously). The problem is I don't want the camera to render the scene rasterized when ray tracing is on, so my theoretical solution was to simply set the culling mask to nothing, but that results in the animated models in the ray traced scene not animating any bone but the first one. Like, their transforms update, but the actual rendered, raytraced scene seems to be using an old matrix for it. Is this a bug? Or anything I could do to work around this?
     
  2. INedelcu

    INedelcu

    Unity Technologies

    Joined:
    Jul 14, 2015
    Posts:
    158
    Hi!

    Try enabling "Update When Offscreen" in your Skinned Mesh Renderer component.
    The Animator component has a "Culling Option" setting. Use Always Animate for this.
     
    Yacker likes this.
  3. Yacker

    Yacker

    Joined:
    Oct 24, 2018
    Posts:
    33
    Ahh, update when offscreen fixed it. I was aware of the culling option for the animator, but not the skinned mesh renderer. Thanks.