Forum posts

Posted 3 years ago2021-06-14 05:56:30 UTC
in Duplicate faces when rendering HL1 BSP map? Post #345700
Maybe I'll still need to figure out its render mechanism,
thx for your reply~
Posted 3 years ago2021-06-13 18:44:55 UTC
in Duplicate faces when rendering HL1 BSP map? Post #345698
I have been working on rendering a simple map for a couple of days and I encountered this problem,
tried figuring out what causing this problem but failed, please help me :(

THE PROBLEM:
Some vertices are running loop twice ( duplicate quad )
https://drive.google.com/file/d/18omWDEi2jYlKgo7ZnW4_eArVKrLARi20/view?usp=sharing

The map to render and RenderDoc file for diagnose:
https://drive.google.com/drive/folders/1R_7hqJh4XbmYSDQzMEid5R32jfTIP7Mt?usp=sharing

The code for getting vertex ids for rendering:
// m_pXXX - Pointer to specific lump data
for (size_t i = 0; i < m_FaceNum; ++i)
{
    for (size_t j = 0; j < m_pFaces[i].edgeNum; ++j)
    {
        Int32 edgeID = m_pSurfaceEdge[m_pFaces[i].firstEdgeId + j];

        if (edgeID > 0)
            IDs.push_back(m_pEdges[edgeID].first);
        else
            IDs.push_back(m_pEdges[-edgeID].second);
    }
}