Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uniform vec2 size;
- uniform vec2 scale;
- uniform vec2 position;
- uniform vec2 region;
- vec2 uv(vec2 uv) {
- vec2 s = vec2(size.x / scale.x, size.x / scale.y);
- vec2 p = vec2(position.x / (size.x / s.x), position.y / (size.y / s.y));
- return vec2(uv.x * s.x - p.x, uv.y * s.y - p.y);
- }
- void fragment() {
- vec4 base = texture(TEXTURE, UV).rgba;
- base.a = texture(base_mask, uv(UV)).a;
- COLOR = base;
- }
Add Comment
Please, Sign In to add comment