Opened 16 months ago

Last modified 11 months ago

#6714 new defect

Some models trigger black screen issues.

Reported by: Stan Owned by:
Priority: Must Have Milestone: Alpha 27
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Stan)

To spot them out you can use

  • source/graphics/ModelDef.cpp

     
    6565        for (size_t i = 0; i < numBones; ++i)
    6666            boneMatrix[i] = boneMatrix[i] * inverseBindBoneMatrix[i];
    6767        for (size_t i = 0; i < numverts; ++i)
    68             result += SkinPoint(verts[i], boneMatrix.data());
     68            result += SkinPoint(verts[i], boneMatrix);
    6969    }
    7070    m_MaxBoundsPerAnimDef[animIndex] = result;
    7171}
    7272
    7373CVector3D CModelDef::SkinPoint(const SModelVertex& vtx,
    74                                const CMatrix3D newPoseMatrices[])
     74                               const std::vector<CMatrix3D>& newPoseMatrices)
    7575{
    7676    CVector3D result (0, 0, 0);
    7777
    7878    for (int i = 0; i < SVertexBlend::SIZE && vtx.m_Blend.m_Bone[i] != 0xff; ++i)
    7979    {
     80        ENSURE(vtx.m_Blend.m_Bone[i] < newPoseMatrices.size());
    8081        result += newPoseMatrices[vtx.m_Blend.m_Bone[i]].Transform(vtx.m_Coords) * vtx.m_Blend.m_Weight[i];
    8182    }
    8283
     
    450451
    451452            for (size_t i = 0; i < mdef->m_NumVertices; ++i)
    452453            {
    453                 mdef->m_pVertices[i].m_Coords = SkinPoint(mdef->m_pVertices[i], &bindPose[0]);
     454                mdef->m_pVertices[i].m_Coords = SkinPoint(mdef->m_pVertices[i], bindPose);
    454455                mdef->m_pVertices[i].m_Norm = SkinNormal(mdef->m_pVertices[i], &bindPose[0]);
    455456            }
    456457        }
  • source/graphics/ModelDef.h

     
    204204     * @return new world-space vertex coordinates
    205205     */
    206206    static CVector3D SkinPoint(const SModelVertex& vtx,
    207         const CMatrix3D newPoseMatrices[]);
     207        const std::vector<CMatrix3D>& newPoseMatrices);
    208208
    209209    /**
    210210     * Transform the given vertex's normal from the bind pose into the new pose.

Currently affected actor (Maybe more):

  • actor|props/structures/celts/merchant_sail_folded.xml
  • actor|props/structures/romans/trireme_fore_sail.xml

Might be related to #1012.

Not sure how to fix it in Blender.

Potential temporary solution: Delete the actor.

Change History (6)

comment:1 by Stan, 16 months ago

Description: modified (diff)

comment:2 by Stan, 16 months ago

In artist terms this means:

comment:3 by Stan, 16 months ago

In 27515:

Fix two broken models causing black glitches.

  • They had vertexes groups without weights.
  • Both of them were unused one incorrectly so.
  • Also fix the material while at it.

Refs #6714

comment:4 by Stan, 16 months ago

Milestone: Alpha 27Alpha 28
Priority: Release BlockerMust Have

Keeping this open until we have proper validation.

comment:5 by Stan, 16 months ago

In 27520:

Fix more issues with animated meshes reported by Phab:P293
Reported by: @trompetin17
Refs #6714

comment:6 by Stan, 11 months ago

Milestone: Alpha 28Alpha 27

Push back

Note: See TracTickets for help on using tickets.