Skip to content

Commit

Permalink
Fix for UV precision on big font texture
Browse files Browse the repository at this point in the history
  • Loading branch information
sammyfreg committed Aug 5, 2024
1 parent 337d251 commit 8da2cf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Client/Private/NetImgui_CmdPackets_DrawFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ inline void ImGui_ExtractVertices(const ImDrawList& cmdList, ImguiDrawGroup& dra
{
const auto& Vtx = cmdList.VtxBuffer[i];
pVertices[i].mColor = Vtx.col;
pVertices[i].mUV[0] = static_cast<uint16_t>((Vtx.uv.x - static_cast<float>(ImguiVert::kUvRange_Min)) * 0xFFFF / (ImguiVert::kUvRange_Max - ImguiVert::kUvRange_Min));
pVertices[i].mUV[1] = static_cast<uint16_t>((Vtx.uv.y - static_cast<float>(ImguiVert::kUvRange_Min)) * 0xFFFF / (ImguiVert::kUvRange_Max - ImguiVert::kUvRange_Min));
pVertices[i].mUV[0] = static_cast<uint16_t>((Vtx.uv.x - static_cast<float>(ImguiVert::kUvRange_Min) + 0.5f/65536.f) * 0xFFFF / (ImguiVert::kUvRange_Max - ImguiVert::kUvRange_Min));
pVertices[i].mUV[1] = static_cast<uint16_t>((Vtx.uv.y - static_cast<float>(ImguiVert::kUvRange_Min) + 0.5f/65536.f) * 0xFFFF / (ImguiVert::kUvRange_Max - ImguiVert::kUvRange_Min));
pVertices[i].mPos[0] = static_cast<uint16_t>((Vtx.pos.x - drawGroupOut.mReferenceCoord[0] - static_cast<float>(ImguiVert::kPosRange_Min)) * 0xFFFF / (ImguiVert::kPosRange_Max - ImguiVert::kPosRange_Min));
pVertices[i].mPos[1] = static_cast<uint16_t>((Vtx.pos.y - drawGroupOut.mReferenceCoord[1] - static_cast<float>(ImguiVert::kPosRange_Min)) * 0xFFFF / (ImguiVert::kPosRange_Max - ImguiVert::kPosRange_Min));
}
Expand Down

0 comments on commit 8da2cf4

Please sign in to comment.