SQL-põhine kiirteede jälgimise süsteem

Aleksei Milovidov, the co-founder of the ClickHouse DBMS, with the assistance of the AI assistant Claude, published a ray tracing system implemented entirely in SQL. The rendering with lighting simulation based on ray tracing is realized as a single SQL query without user-defined functions (UDF) and without external code integration. The ClickHouse DBMS's ability to save query results in PNG format is used for graphics output. The project works fully when run in the ClickHouse DBMS, but can operate in the CedarDB DBMS with some errors and 33 times slower. The project is distributed under the Creative Commons BY-NC-SA license.

Each pixel represents a row in a table, which contains columns for coordinates (X, Y) and color representation (R, G, B). The necessary mathematical operations for 3D calculations are built on tuples — a vector is encoded as Tuple(Float64, Float64, Float64).
Valguspeegelduste simuleerimise tsükkel on rakendatud SQL-funktsiooni arrayFold kaudu ning see toimub iga rea sees renderdamise paraleliseerimiseks. Geomeetriliste primitiivide hulka kuuluvad silindrid, toroidid, sfäärid ja suunatud parallelepipedid, millele tehakse ühendamise ja erinevuse (ristumiste eemaldamise) operatsioone. Maastik genereeritakse matemaatiliselt.

Varem on ClickHouse andmebaasi arendajad valmistanud SQL-i põhjal Doomilaadse mängu, RISC-V emulaatori ja muusika sünteesija.

Allikas: opennet.ru

Osta usaldusväärne veebihosting DDoS kaitsega, VPS VDS serverid 🔥 Osta usaldusväärne veebihosting DDoS kaitsega, VPS VDS serverid | ProHoster