7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
18#define history_head int(ext.u3.x)
19#define iFrame int(ext.u2.x)
22layout(local_size_x = 16, local_size_y = 16) in;
23layout(set = 0, binding = 5, rgba8) writeonly uniform image2D outputImage;
24layout(set = 0, binding = 0) uniform sampler2D samp;
35 return clamp(p, ivec2(0), size - ivec2(1));
45 return (vec2(
clampPos(p, size)) + 0.5) / vec2(size);
55 return textureLod(samp,
pixelUv(p, size), 0.0).rgb;
63 return max(
int(round(mix(2.0, 64.0, clamp(
alpha, 0.0, 1.0)))), 1);
70#ifndef USE_HISTORY_TEXTURE_ARRAY
71#define USE_HISTORY_TEXTURE_ARRAY 1
74#if USE_HISTORY_TEXTURE_ARRAY
75layout(set = 0, binding = 2) uniform sampler2DArray history;
78uniform sampler2D textures[
SIZE];
98 index = clamp(index, 0,
SIZE - 1);
99#if USE_HISTORY_TEXTURE_ARRAY
101 return textureLod(history, vec3(uv,
float(layer)), 0.0).rgb;
103 return textureLod(textures[index], uv, 0.0).rgb;
122 ivec2 p = ivec2(gl_GlobalInvocationID.xy);
123 ivec2 size = imageSize(outputImage);
124 if (any(greaterThanEqual(p, size)))
127 imageStore(outputImage, p, vec4(clamp(color, 0.0, 1.0), 1.0));
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
ivec2 clampPos(ivec2 p, ivec2 size)
Evaluates clampPos for this shader effect.
int effectBlockSize()
Evaluates effectBlockSize for this shader effect.
vec2 pixelUv(ivec2 p, ivec2 size)
Evaluates pixelUv for this shader effect.
vec3 sampleSource(ivec2 p, ivec2 size)
Evaluates sampleSource for this shader effect.
int effectHistoryIndex()
Evaluates effectHistoryIndex for this shader effect.
vec3 columnBlend(ivec2 p, ivec2 size)
Evaluates columnBlend for this shader effect.
float sampleHistory(int index, float frequency)
Evaluates sampleHistory for this shader effect.