Kiirtekkesüsteem, mis on teostatud SQL keeles

Aleksandr Milovidov, ClickHouse DBMS co-founder, with the assistance of AI assistant Claude, published a ray tracing system entirely implemented in SQL. Rendering with light simulation based on path tracing is executed as a single SQL query without user-defined functions (UDF) and without connecting external code. To output graphics, ClickHouse DBMS uses the ability to save query results in PNG format. The project operates fully when run in ClickHouse DBMS, but may run 33 times slower and with some errors in CedarDB. The project is distributed under the Creative Commons BY-NC-SA license.

Each pixel represents a row in a table, which includes columns for coordinates (X, Y) and color representation (R, G, B). The mathematical operations necessary for 3D calculations are built on tuples — a vector is encoded as Tuple(Float64, Float64, Float64).
The cycle for simulating multiple light reflections from surfaces is implemented through the SQL function arrayFold and is performed within each row to parallelize rendering. Supported geometric primitives include cylinders, tori, spheres, and oriented parallelepipeds, on which union and difference operations (removing intersections) are performed. The landscape is generated mathematically.

Previously, ClickHouse DBMS developers prepared a Doom-like game written in SQL, a RISC-V emulator, and a music synthesizer.

Allikas: opennet.ru

Osta usaldusväärne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid 🔥 Osta usaldusväärne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid | ProHoster