7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
19layout(local_size_x = 16, local_size_y = 16) in;
20layout(set = 0, binding = 5, rgba8) writeonly uniform image2D outputImage;
21layout(set = 0, binding = 0) uniform sampler2D samp;
29vec3
source_at(ivec2 p, ivec2 s) { p = clamp(p, ivec2(0), s - 1);
return textureLod(samp, (vec2(p) + 0.5) / vec2(s), 0.0).rgb; }
35uvec3
bytes(vec3 c) {
return uvec3(clamp(c * 255.0, 0.0, 255.0)); }
40 ivec2 p = ivec2(gl_GlobalInvocationID.xy), s = imageSize(outputImage);
if (any(greaterThanEqual(p, s)))
return;
41 vec3 src =
source_at(p, s); uvec3 key = uvec3((p.x * 3 + p.y) & 255, (p.x + p.y * 2) & 255, (p.x * 2 + p.y * 3) & 255); vec3 effect = vec3(
bytes(src) ^ key) / 255.0;
42 imageStore(outputImage, p, vec4(mix(src, effect,
alpha), 1.0));
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
vec3 source_at(vec2 position, ivec2 size)
Evaluates source at for this shader effect.
uvec3 bytes(vec3 c)
Evaluates bytes for this shader effect.