Merge pull request #97260 from clayjohn/pixel_snap
Calculate pixel snap in canvas space instead of world space
This commit is contained in:
commit
5f5c690481
|
@ -262,6 +262,8 @@ void main() {
|
||||||
|
|
||||||
color_interp = color;
|
color_interp = color;
|
||||||
|
|
||||||
|
vertex = (canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
||||||
|
|
||||||
if (use_pixel_snap) {
|
if (use_pixel_snap) {
|
||||||
vertex = floor(vertex + 0.5);
|
vertex = floor(vertex + 0.5);
|
||||||
// precision issue on some hardware creates artifacts within texture
|
// precision issue on some hardware creates artifacts within texture
|
||||||
|
@ -269,8 +271,6 @@ void main() {
|
||||||
uv += 1e-5;
|
uv += 1e-5;
|
||||||
}
|
}
|
||||||
|
|
||||||
vertex = (canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
|
||||||
|
|
||||||
vertex_interp = vertex;
|
vertex_interp = vertex;
|
||||||
uv_interp = uv;
|
uv_interp = uv;
|
||||||
|
|
||||||
|
|
|
@ -214,6 +214,8 @@ void main() {
|
||||||
|
|
||||||
color_interp = color;
|
color_interp = color;
|
||||||
|
|
||||||
|
vertex = (canvas_data.canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
||||||
|
|
||||||
if (canvas_data.use_pixel_snap) {
|
if (canvas_data.use_pixel_snap) {
|
||||||
vertex = floor(vertex + 0.5);
|
vertex = floor(vertex + 0.5);
|
||||||
// precision issue on some hardware creates artifacts within texture
|
// precision issue on some hardware creates artifacts within texture
|
||||||
|
@ -221,8 +223,6 @@ void main() {
|
||||||
uv += 1e-5;
|
uv += 1e-5;
|
||||||
}
|
}
|
||||||
|
|
||||||
vertex = (canvas_data.canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
|
||||||
|
|
||||||
vertex_interp = vertex;
|
vertex_interp = vertex;
|
||||||
uv_interp = uv;
|
uv_interp = uv;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue