Sistem gjurmimi rrezesh i implementuar në gjuhën SQL

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

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

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

Burimi: opennet.ru

Blini hosting tĂ« besueshĂ«m pĂ«r faqe interneti me mbrojtje nga DDoS, serverĂ« VPS VDS đŸ”„ Blini hosting tĂ« besueshĂ«m pĂ«r faqe interneti me mbrojtje nga DDoS, serverĂ« VPS VDS | ProHoster