Depending on this craving you will be rewarded with winnings.
A simple game that you can play in your free time.

2D, 3D, game, games, online game, game development, game engine, programming, OpenGL, Open AI, math, graphics, design, graphic, graphics, game development, game engine, programming, web development, web art, web graphic, arts, tutorial, tutorials,
// this size of line to paint each pixel from screen
const float size = 0.01;
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fragCoord/iResolution.xy;
// resize uv
uv = uv * 2.0;
// translate normalized pixel coordinates uv from [0,1] to [-1, 1] with
uv = (uv - 1.0);
// get uv.x aspect ratio
uv.x *= iResolution.x / iResolution.y;
// get simple sine
//float t = sin(uv.x);
// get sine * 3 with same size uv will zoom the sine graphic
// see also https://en.wikipedia.org/wiki/Sine_wave
float t = sin(uv.x * 3.0);
// select domain area of sine and drwa yellow color
// else put an blue color on rest
if (uv.y >= t - size && uv.y <= t + size) {
// draw sine
fragColor = vec4(1.0,1.0,0.0,1.0);
} else {
// draw background
fragColor = vec4(0.0,0.0,1.0,1.0);
}
}
The result of this shader is this:![]() |
// learning process area step by step
// the gl_FragColor is a vec4 type of float values in the range 0 to 1.
// because the values are from 0 to 1 this can used in many ways with for domain and range
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fragCoord/iResolution.xy;
// define a vec2 and uv can be divide to create waves
// use this to see the difference
// vec2 valul = vec2(0.01,1.0);
vec2 valul = vec2(0.5,1.0);
// define a vec2 this vector will be the vector of shadow
vec2 unghi_valul = vec2(0.5,1.0);
// this float will speed the animation with iTime
float viteza = 3.0;
// with the dot we can calculate the dot product of two vectors and result can be a shadow
// the result of unghi can be changed when change the vectors and vectors math rules
float unghi = dot(uv/valul, unghi_valul) - iTime * viteza;
// the output can be used with sin to create a shadow wave
// fill the screen with red
fragColor = vec4(1,0,0,0) * sin(unghi);
// fill the 2/3 of size with yellow color
if(uv.x<(1.0/1.5))
fragColor = vec4(1,1,0,0) * sin(unghi);
// fill the last 1/3 with the blue color
if(uv.x<1.0/3.0)
fragColor = vec4(0,0,1,0) * sin(unghi);
}
The result of this source code: