summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGuilherme Silva <guilhermefelipecgs@gmail.com>2017-12-19 15:18:07 -0200
committerGuilherme Silva <guilhermefelipecgs@gmail.com>2017-12-19 15:18:07 -0200
commitffe827ab5a25ee033dbea2374fd93b84bebc0788 (patch)
tree900814bf81e52383b3cce379e2eb6013f6d9852d /drivers
parenta714e1a4c77dc8236d7dfa6628ba40ddc534d1a4 (diff)
Fix pixel snap not being used in 3.0
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp2
-rw-r--r--drivers/gles3/shaders/canvas.glsl2
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 5d93c6a982..a4daa77b50 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1784,6 +1784,8 @@ void RasterizerCanvasGLES3::initialize() {
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows);
state.canvas_shadow_shader.set_conditional(CanvasShadowShaderGLES3::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows);
+
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PIXEL_SNAP, GLOBAL_DEF("rendering/quality/2d/use_pixel_snap", false));
}
void RasterizerCanvasGLES3::finalize() {
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 4bbb18ce42..0b8230234b 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -171,7 +171,7 @@ VERTEX_SHADER_CODE
#ifdef USE_PIXEL_SNAP
- outvec.xy=floor(outvec+0.5);
+ outvec.xy=floor(outvec+0.5).xy;
#endif