prosperon/shaders/sprite.cg

20 lines
279 B
Plaintext
Raw Normal View History

2024-05-30 17:12:54 -05:00
@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
2024-10-04 00:45:44 -05:00
2024-05-30 17:12:54 -05:00
void frag()
{
color = texture(sampler2D(diffuse,smp), uv);
if (color.a == 0) discard;
2024-05-30 17:12:54 -05:00
}
@end
#include <base.cg>