Skip to content

Commit

Permalink
Fix external texture UVs that are inverted with image brush shader.
Browse files Browse the repository at this point in the history
  • Loading branch information
gw3583 committed Feb 21, 2018
1 parent 2d2d7b7 commit 5b73194
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webrender/res/brush_image.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ void brush_vs(
vUv.xy = mix(uv0, uv1, f);
vUv.xy /= texture_size;

vUvBounds = vec4(uv0 + vec2(0.5), uv1 - vec2(0.5)) / texture_size.xyxy;
// Handle case where the UV coords are inverted (e.g. from an
// external image).
vUvBounds = vec4(
min(uv0, uv1) + vec2(0.5),
max(uv0, uv1) - vec2(0.5)
) / texture_size.xyxy;

#ifdef WR_FEATURE_ALPHA_PASS
vLocalPos = vi.local_pos;
Expand Down

0 comments on commit 5b73194

Please sign in to comment.