15 lines
476 B
Plaintext
15 lines
476 B
Plaintext
|
|
layout(binding=0) readonly texture2D src;
|
||
|
|
layout(binding=1) writeonly texture2D dest;
|
||
|
|
|
||
|
|
noinline void desaturate(readonlyTexture2D src, writeonlyTexture2D dest) {
|
||
|
|
half4 color = read(src, sk_GlobalInvocationID.xy);
|
||
|
|
color.rgb = half3(dot(color.rgb, half3(0.22, 0.67, 0.11)));
|
||
|
|
write(dest, sk_GlobalInvocationID.xy, color);
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
if (sk_GlobalInvocationID.x < width(src) && sk_GlobalInvocationID.y < height(src)) {
|
||
|
|
desaturate(src, dest);
|
||
|
|
}
|
||
|
|
}
|