From e2e87ba86bf119be950ecdcb57881a86b004478f Mon Sep 17 00:00:00 2001 From: Umut SEVER <2404005065@ogrenci.sbu.edu.tr> Date: Wed, 9 Sep 2026 18:52:48 +0300 Subject: [PATCH] docs: rewrite the README in English Every measured number is carried over unchanged: 20,485 triangles, 527,240 fragments, 275.91 ms total, 66.0% coverage, 81.99/255 mean brightness, 65.1% and 223.67 for the bundle check. The Limits section keeps saying that no browser fps figure was measured. --- README.md | 155 +++++++++++++++++++++++++----------------------------- 1 file changed, 71 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 690538f..ba3f8d6 100644 --- a/README.md +++ b/README.md @@ -1,148 +1,135 @@
- GPU kullanmadan, her pikseli JavaScript'te tek tek hesaplayan bir 3D renderer.
- Üçgen taraması, z-buffer, gölge haritası, aydınlatma, tonemapping. Hepsi elle yazıldı.
- canvas yalnızca hazır piksel dizisini ekrana basmak için var.
+ A 3D renderer that uses no GPU and computes every pixel one by one in JavaScript.
+ Triangle scan, z-buffer, shadow map, lighting, tonemapping. All of it written by hand.
+ canvas exists only to blit the finished pixel array to the screen.
- Canlı demo + Live demo
--- -## 30 saniyede ne oluyor? +## What happens in the first 30 seconds ```bash git clone https://github.com/umutseve4/scanline && cd scanline -npm run build # → dist/scanline.html +npm run build # -> dist/scanline.html ``` -Çıkan tek dosyayı çift tıkla. Sunucu, kurulum, internet gerekmez. +Double click the single file that comes out. No server, no install, no internet needed. -Kaynaktan çalıştırmak istersen (ES modülleri için basit bir sunucu yeterli): +If you would rather run it from source, any simple server will do for ES modules: ```bash -python3 -m http.server 8000 # sonra http://localhost:8000 +python3 -m http.server 8000 # then http://localhost:8000 ``` -Ekranda: dönen bir (2,3) torus knot, zıplayan bir küre, dönen bir küp ve satranç -tahtası zemin; yönlü ışık, 3×3 PCF yumuşak gölge, Blinn-Phong specular ve ACES -tonemap ile gerçek zamanlı çiziliyor. +On screen: a rotating (2,3) torus knot, a bouncing sphere, a spinning cube and a checkerboard floor, drawn in real time with a directional light, a 3x3 PCF soft shadow, a Blinn-Phong specular and an ACES tonemap. -## Kontroller +## Controls -| Kontrol | Açıklama | +| Control | What it does | | --- | --- | -| Mod | `shaded`, `normals`, `depth` (linearize edilmiş), `uv` | -| Gölge haritası | 768×768 shadow map + PCF açık/kapalı | -| Wireframe | Bresenham çizgilerle tel kafes overlay | -| Çözünürlük | 0.25x ile 1.0x iç render ölçeği | -| Pozlama | ACES öncesi exposure 0.30 ile 2.50 | -| PNG kaydet | O anki kareyi indirir | +| Mode | `shaded`, `normals`, `depth` (linearised), `uv` | +| Shadow map | 768x768 shadow map plus PCF, on or off | +| Wireframe | Wireframe overlay drawn with Bresenham lines | +| Resolution | Internal render scale from 0.25x to 1.0x | +| Exposure | Pre ACES exposure from 0.30 to 2.50 | +| Save PNG | Downloads the current frame | -Kısayollar: `W` wireframe, `S` gölge, `Space` duraklat, `1` ile `4` render modu. -Fare ile sürükle = yörünge, tekerlek = zoom. HUD canlı olarak fps, kare süresi, -çözünürlük, rasterize edilen üçgen, shade edilen fragment, clip edilen üçgen ve -pass başına milisaniye gösterir. +Shortcuts: `W` wireframe, `S` shadow, `Space` pause, `1` to `4` render mode. Drag with the mouse to orbit, wheel to zoom. The HUD shows fps, frame time, resolution, rasterised triangles, shaded fragments, clipped triangles and milliseconds per pass, live. -## Ölçülen referans değerler +## Measured reference numbers -Node 24, tek çekirdek, 960×600, **20.485 üçgen**, **527.240 fragment**, 2 üçgen -near-plane'de kırpıldı: +Node 24, single core, 960x600, **20,485 triangles**, **527,240 fragments**, 2 triangles clipped at the near plane: -| Pass | Süre | +| Pass | Time | | --- | --- | | Shadow pass | 43.63 ms | -| Geometry + shading | 178.76 ms | +| Geometry and shading | 178.76 ms | | Resolve | 53.52 ms | -| **Toplam** | **275.91 ms** | +| **Total** | **275.91 ms** | -Aynı koşuda konu kapsama oranı **%66.0**, ortalama parlaklık **81.99/255**. Bundle -doğrulaması 675×420'de **%65.1** kapsama ve **223.67** maksimum luma ile geçti. +In the same run, subject coverage was **66.0%** and mean brightness **81.99/255**. Bundle verification passed at 675x420 with **65.1%** coverage and a maximum luma of **223.67**. -## Doğrulama +## Verification -CI (`.github/workflows/ci.yml`) her push'ta beş adım çalıştırır ve hiçbiri -"derlendi, demek ki çalışıyor" varsayımına dayanmaz: +CI (`.github/workflows/ci.yml`) runs five steps on every push, and none of them rests on the assumption that "it built, so it works": -| Adım | Ne kanıtlıyor | +| Step | What it proves | | --- | --- | -| `test` | 18 matematik assertion'ı: `lookAt` kamerayı origin'e taşıyor mu, `perspective` near/far düzlemlerini tam olarak −1/+1'e eşliyor mu, `normalMatrix` non-uniform scale altında dikliği koruyor mu, tekil matriste identity'ye düşüyor mu | -| `still` | Headless kare render eder, piksel istatistiklerini denetler. **Siyah veya düz bir kare CI'ı düşürür** | -| `modes` | Dört render modunu ayrı ayrı render edip hash'lerinin farklı olduğunu doğrular (bozuk mod switch'i dört aynı kare üretirdi) | -| `build` | Altı ES modülünü tek HTML'e gömer; artıkta `import`/`export` kalırsa hata verir | -| `verify` | Üretilen tek dosyayı Node'un `vm`'inde minimal DOM stub'ıyla **çalıştırır**, `putImageData`'ya giden gerçek pikselleri yakalar, kapsama/parlaklık eşiklerini kontrol eder | +| `test` | 18 maths assertions: does `lookAt` move the camera to the origin, does `perspective` map the near and far planes exactly to -1 and +1, does `normalMatrix` keep perpendicularity under non uniform scale, does it fall back to identity on a singular matrix | +| `still` | Renders a headless frame and inspects the pixel statistics. **A black or flat frame fails CI** | +| `modes` | Renders the four render modes separately and verifies their hashes differ (a broken mode switch would produce four identical frames) | +| `build` | Inlines six ES modules into one HTML file, and errors out if any `import` or `export` is left in the output | +| `verify` | **Runs** the produced single file inside Node's `vm` with a minimal DOM stub, captures the real pixels heading for `putImageData`, and checks the coverage and brightness thresholds | -Yani test edilen "bundle parse oluyor" değil, **"bundle görüntü çiziyor"**. +So what is tested is not "the bundle parses", it is **"the bundle draws an image"**.