Guest User

Untitled

a guest
Nov 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. uniform vec2 size;
  2. uniform vec2 scale;
  3. uniform vec2 position;
  4. uniform vec2 region;
  5.  
  6. vec2 uv(vec2 uv) {
  7. vec2 s = vec2(size.x / scale.x, size.x / scale.y);
  8. vec2 p = vec2(position.x / (size.x / s.x), position.y / (size.y / s.y));
  9. return vec2(uv.x * s.x - p.x, uv.y * s.y - p.y);
  10. }
  11.  
  12. void fragment() {
  13. vec4 base = texture(TEXTURE, UV).rgba;
  14. base.a = texture(base_mask, uv(UV)).a;
  15. COLOR = base;
  16. }
Add Comment
Please, Sign In to add comment