AnyPortrait > Forum > How to Use

[Archive] Mesh is not visible when object size is inverted during animation

  • This topic has 0 replies, 1 voice, and was last updated 1 week ago by Archive AccountArchive Account.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1281
    Archive AccountArchive Account

      Q.

      During the animation, I set the object’s Transform Scale to (-1, 1) in a keyframe to make the object flip.
      Then, when I checked in-game, the object was not rendered.

       

      A.

      AnyPortrait’s default material renders only the front face like a typical 3D model.
      In the AnyPortrait editor, it is drawn regardless of the front/back face, but in-game, depending on the material’s characteristics, the back face may not be rendered.

      Even if you invert the size of the mesh in the Transform Modifier, it will usually be rendered normally.
      This is because AnyPortrait detects the inversion of the size of the mesh or mesh group and switches the front or back face to ensure proper rendering.

      However, it does not work with the Morph Modifier or Rigging Modifier that detects the front and back faces.
      This is because these modifiers work on a “vertex” basis, not a mesh basis.

      Here are some ways to solve this problem:

       

      1. If you want to invert the size of some meshes, you can easily solve this by making the meshes “2-Sided”.
      However, be careful because this method will double the number of vertices in the mesh.
      https://rainyrizzle.github.io/en/AdvancedManual/AD_2SidedMesh.html

       

      2. If you are inverting the size of the bone, you can also solve it with the Bake option.
      The function described in the manual below detects the front and back sides in the Rigging Modifier only when all the bones rigged to the target mesh are inverted at once.
      However, if only some bones are inverted, you should use “Method 1”.
      https://rainyrizzle.github.io/en/AdvancedManual/AD_ReversedRiggedMesh.html

       

      3. If you write a custom shader and specify “Cull Off” in that shader, it will always render regardless of the front/back.
      However, this is not recommended as it can cause problems with translucent rendering, etc.

       

      4. If you are flipping the entire character, it is better to control the Scale of the GameObject, not inside AnyPortrait.
      However, since there is no way to control it in the AnyPortrait editor, you need to send the flip timing to a script with an animation event, etc., and then control the Scale of the GameObject in the script.
      Generally, if the Scale contains a negative number, a Drawcall optimization problem occurs, but AnyPortrait detects the Scale of the GameObject and maintains Drawcall optimization, so you don’t have to worry about it.
      – Animation Event: https://rainyrizzle.github.io/en/AdvancedManual/AD_AnimationEvents.html
      – Inverted Scale and Drawcall: https://rainyrizzle.github.io/en/AdvancedManual/AD_InvertedScale.html

       

    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.
    Scroll to Top