2016-10-21 18:34:38 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Stanlo Slasinski. All rights reserved.
|
2022-01-15 22:59:06 +03:00
|
|
|
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
|
2016-10-21 18:34:38 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bgfx_compute.sh"
|
|
|
|
|
2017-05-29 20:43:50 +03:00
|
|
|
IMAGE2D_ARRAY_WR(s_texColor, rgba8, 0);
|
2016-10-21 18:34:38 +03:00
|
|
|
uniform vec4 u_time;
|
|
|
|
|
|
|
|
NUM_THREADS(16, 16, 1)
|
|
|
|
void main()
|
|
|
|
{
|
2017-05-29 20:43:50 +03:00
|
|
|
vec3 colors[] =
|
|
|
|
{
|
|
|
|
vec3(1.0, 0.0, 0.0),
|
|
|
|
vec3(1.0, 1.0, 0.0),
|
|
|
|
vec3(1.0, 0.0, 1.0),
|
|
|
|
vec3(0.0, 1.0, 0.0),
|
|
|
|
vec3(0.0, 1.0, 1.0),
|
|
|
|
vec3(0.0, 0.0, 1.0),
|
2016-10-21 18:34:38 +03:00
|
|
|
};
|
|
|
|
|
2017-05-29 20:43:50 +03:00
|
|
|
for (int face = 0; face < 6; face++)
|
2016-10-21 18:34:38 +03:00
|
|
|
{
|
2017-05-29 20:43:50 +03:00
|
|
|
vec3 color = colors[face]*0.75 + sin(u_time.x*4.0)*0.25;
|
|
|
|
ivec3 dest = ivec3(gl_GlobalInvocationID.xy, face);
|
2019-01-16 20:24:06 +03:00
|
|
|
imageStore(s_texColor, dest, vec4(color, 1.0) );
|
2016-10-21 18:34:38 +03:00
|
|
|
}
|
|
|
|
}
|