[core] Update sdf shader code

Ported the following patch:
- [convert mat4 exMatrix to a vec2 extrudeScale](a8d549b7a4)
This commit is contained in:
Bruno de Oliveira Abinader
2016-06-01 10:50:45 +03:00
parent 5e7736ce87
commit 59f9a9f93c
5 changed files with 28 additions and 37 deletions

View File

@@ -97,9 +97,7 @@ void Painter::render(const Style& style, const FrameData& frame_, SpriteAtlas& a
// Update the default matrices to the current viewport dimensions.
state.getProjMatrix(projMatrix);
// The extrusion matrix.
matrix::ortho(extrudeMatrix, 0, state.getWidth(), state.getHeight(), 0, 0, -1);
// The extrusion scale.
const float flippedY = state.getViewportMode() == ViewportMode::FlippedY;
extrudeScale = {{ 2.0f / state.getWidth() * state.getAltitude(),
(flippedY ? 2.0f : -2.0f) / state.getHeight() * state.getAltitude() }};