@block vert uniform vec4 rect; uniform vec2 diffuse_size; void vert() { pos *= vec3(diffuse_size * rect.zw,1); uv = (uv*rect.zw)+rect.xy; } @end @block frag void frag() { color = texture(sampler2D(diffuse,smp), uv); if (color.a != 0) discard; } @end #include