... from 2020 an old video with a good Graphics User Interface! I miss some news from the last few years.
Learn more and buy Equator2 here: https://bit.ly/Equator_2.
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,
...into this:p_m = 1.0-p_m/(p_m+0.1);
or this:p_m = 1.0-p_m*10.0/(p_m*10.0+0.1);
The shader can be ru and testd here:// 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: