Sign in

Expected 123 everywhere, screenshot from ANGLE DX11, Nvidia https://www.shadertoy.com/view/tlfBRB
  1. Reading float bits from texture and losing float bits. (first screenshot)
  2. Precompiled floats. CPU vs GPU.
  3. More about float bits and int/uint, float can be equal to 0. but

Reading float bits from texture and losing float bits:

Screenshot above. Test shader shadertoy link. Expected 123 everywhere.

Blue number result of this operation (line 29 in shadertoy code):

uint value_2 = floatBitsToUint(uintBitsToFloat(uint(value+iZero))+fZero);

Result — can be 0 or value, depends on GPU and GPU shader language.
Reason
— uintBitsToFloat(uint(value+iZero)) save value as float bits, but for test I use small uint value 123.
And the sum of float(<from uint 123>) + 0. …


GLSL Auto Tetris

Make the maximum number of simultaneously launched Tetrises for one shader (one Framebuffer texture).

This is the 2021 updated version.

Shader should work fine on every 2015+ Nvidia GPU.
AMD just updated their GPU driver (update to latest driver version, summer 2021 or newer) and this shader now works on AMD GPUs also (tested Vega8 and AMD 560).

Each Tetris runs in three pixels, for 1920x1080 resolution 619200 copies can be run at the same time.
Tetris board…


Screenshot from https://www.shadertoy.com/view/3syXDD

This is not a tutorial, I write only about my way of creating logic and some useful tips and code.

Useful Shaders and Shadertoy related links and tips in my previous blog post.

Content:

  1. Useful code for data saving/loading.
  2. 2D drawing/creating graphics.
  3. Optimization and debugging.
  4. The edge of the Games in GPU.
  5. Links to my own games in the shaders.
  6. Export template.

How it works:

Shadertoy implementation of “buffer logic” allows read from “buffer previous frame data”(BufferA read self when binded as one of iChannels).

Basic logic —in the buffer on Frame 0 init data and on next frames execute game logic reading…


Links and small descriptions to useful shader-related stuff.

Shadertoy is a great place to create and discover amazing shader-related projects. https://www.shadertoy.com/

iquilezles.org — I highly recommend all materials and articles on this website, created by Inigo Quilez.
Articles include very useful materials such as 2D SDF and 3D SDF, intersectors functions for analytic raycasting, smoothstep like functions, and many others worth checking.

shadertoyunofficial.wordpress.com — lots of useful tips and materials about Shadertoy and shaders, created by Fabrice NEYRET.
Usual tricks in Shadertoy some basics and not very obvious tips, Special Shadertoy features info about Shadertoy variables and resources format.
Shadertoy media files


Only for KDE 5 (Plasma desktop) and Gnome 3 (Gnome Shell). Wayland and X11.

KDE 5 Plasma plugin

Install KDE / Plasma — Shader Wallpaper plugin github link.
Plugin can be installed directly from KDE Plasma desktop options. Instruction:

  • Right click on your desktop > Configure Desktop
  • Click on the “Get New Plugins” button
  • Search and Install the latest version of “Shader Wallpaper”

Warning: some of the shaders that installed by default in that “Shader Wallpaper” may crash GPU driver or have a very bad performance, click carefully.

For example - my own shader can be used as Desktop wallpaper for “Shader Wallpaper” plugin…


Animation from my GLSL shaders in loops as YouTube and GIFs.
Source code linked for every animation.

Animation recorded using Python script:
https://github.com/danilw/shadertoy-to-video-with-FBO

Videos on YouTube are looped, right-click on the video and select “Loop”. Short animations in GIFs.

YouTube playlist.

Animation loops:

1. Cube lines shader https://www.shadertoy.com/view/NslGRN

This animation also made from Cube Lines shader:

2. Bright cubes shader https://www.shadertoy.com/view/Nt2Szm

3. Light box shader https://www.shadertoy.com/view/tsfGW4

4. Shadertoy recursion shader https://www.shadertoy.com/view/3stSRH

5. Animation shader for project e-ani https://www.shadertoy.com/view/Wdt3zj

6. …

Danil

GLSL and usual coding

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store