mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-26 23:59:30 +00:00
smoothing out results from gui shaders
roundedRectangle and circle drawing now smooth out their results
This commit is contained in:
parent
2dc623df7e
commit
0d448ad761
6 changed files with 57 additions and 52 deletions
|
|
@ -627,6 +627,11 @@ void GFXDrawUtil::drawRoundedRect(const F32& cornerRadius,
|
|||
Point2F rectCenter((F32)(topLeftCorner.x + (size.x / 2.0)), (F32)(topLeftCorner.y + (size.y / 2.0)));
|
||||
mRoundRectangleShaderConsts->setSafe(mRoundRectangleShader->getShaderConstHandle("$rectCenter"), rectCenter);
|
||||
|
||||
const Point2I& resolution = GFX->getActiveRenderTarget()->getSize();
|
||||
Point2F TargetSize(1.0 / (F32)resolution.x, 1.0 / (F32)resolution.y);
|
||||
|
||||
mRoundRectangleShaderConsts->setSafe(mRoundRectangleShader->getShaderConstHandle("$oneOverViewport"), TargetSize);
|
||||
|
||||
mDevice->drawPrimitive(GFXTriangleStrip, 0, 2);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue