mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 12:05:38 +00:00
Reintroduced vertex roundings as it improves texture mapping accuracy
This commit is contained in:
parent
a3b49b87b0
commit
b7e3d3064d
|
@ -583,6 +583,10 @@ void GIFAnimComponent::render(const glm::mat4& parentTrans)
|
|||
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
||||
// clang-format on
|
||||
|
||||
// Round vertices.
|
||||
for (int i {0}; i < 4; ++i)
|
||||
vertices[i].position = glm::round(vertices[i].position);
|
||||
|
||||
vertices->brightness = mBrightness;
|
||||
vertices->saturation = mSaturation * mThemeSaturation;
|
||||
vertices->opacity = mOpacity * mThemeOpacity;
|
||||
|
|
|
@ -874,6 +874,10 @@ void ImageComponent::updateVertices()
|
|||
|
||||
updateColors();
|
||||
|
||||
// Round vertices.
|
||||
for (int i {0}; i < 4; ++i)
|
||||
mVertices[i].position = glm::round(mVertices[i].position);
|
||||
|
||||
if (mFlipX) {
|
||||
for (int i {0}; i < 4; ++i)
|
||||
mVertices[i].texcoord[0] = px - mVertices[i].texcoord[0];
|
||||
|
|
|
@ -574,6 +574,10 @@ void LottieAnimComponent::render(const glm::mat4& parentTrans)
|
|||
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
||||
// clang-format on
|
||||
|
||||
// Round vertices.
|
||||
for (int i {0}; i < 4; ++i)
|
||||
vertices[i].position = glm::round(vertices[i].position);
|
||||
|
||||
vertices->brightness = mBrightness;
|
||||
vertices->saturation = mSaturation * mThemeSaturation;
|
||||
vertices->opacity = mOpacity * mThemeOpacity;
|
||||
|
|
|
@ -129,6 +129,10 @@ void NinePatchComponent::buildVertices()
|
|||
(*mVertices)[v + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0};
|
||||
// clang-format on
|
||||
|
||||
// Round vertices.
|
||||
for (int i {1}; i < 5; ++i)
|
||||
(*mVertices)[v + i].position = glm::round((*mVertices)[v + i].position);
|
||||
|
||||
// Make duplicates of first and last vertex so this can be rendered as a triangle strip.
|
||||
(*mVertices)[v + 0] = (*mVertices)[v + 1];
|
||||
(*mVertices)[v + 5] = (*mVertices)[v + 4];
|
||||
|
|
|
@ -199,6 +199,10 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
|
|||
vertices[2].color = mColorGradientHorizontal ? mColorShiftEnd : mColorShift;
|
||||
vertices[3].color = mColorShiftEnd;
|
||||
|
||||
// Round vertices.
|
||||
for (int i {0}; i < 4; ++i)
|
||||
vertices[i].position = glm::round(vertices[i].position);
|
||||
|
||||
if (mFadeIn < 1.0f || mThemeOpacity < 1.0f)
|
||||
vertices->opacity = mOpacity * mThemeOpacity;
|
||||
|
||||
|
|
|
@ -486,6 +486,10 @@ void Renderer::drawRect(const float x,
|
|||
vertices[3] = {{x + wL, y + hL}, {0.0f, 0.0f}, colorEnd};
|
||||
// clang-format on
|
||||
|
||||
// Round vertices.
|
||||
for (int i {0}; i < 4; ++i)
|
||||
vertices[i].position = glm::round(vertices[i].position);
|
||||
|
||||
vertices->opacity = opacity;
|
||||
vertices->dimming = dimming;
|
||||
|
||||
|
|
Loading…
Reference in a new issue