Table of contents
Output An Image
Use Template
-
Supports:
-
Recursive clone
1git clone https://github.com/zichen34/RayTracing-Cherno.git -
Install development system dependencies: r1-GPT5
1 2 3 4 5 6sudo apt update sudo apt install -y build-essential git cmake \ libx11-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev \ libgl1-mesa-dev libvulkan-dev vulkan-tools \ libwayland-dev libxkbcommon-dev \ libglm-dev
::: aside
:::References
{{{ -
Build Premake5 From Source
-
Problems:
-
The lastest released binary
premake-5.0.0-beta7requiresGLIBC_2.38Commands of installing prebuilt bin
{{{ ```shell # Quick option: download a premake5 binary wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta7/premake-5.0.0-beta7-linux.tar.gz tar -xzf premake-5.0.0-beta7-linux.tar.gz sudo mv premake5 /usr/local/bin/ premake5 --version ``` }}}The binary
premake5is not usable due a GLIBC mismatch:1 2 3zichen@zichen-X570-AORUS-PRO-WIFI:~/Downloads$ premake5 --version premake5: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by premake5) premake5: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by premake5)
-
-
Supports:
-
Check GLIBC version:
1 2ldd --version # glibc version lsb_release -ds # Ubuntu versionOutput
{{{ ```shell zichen@zichen-X570-AORUS-PRO-WIFI:~/Downloads$ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3.11) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.zichen@zichen-X570-AORUS-PRO-WIFI:~/Downloads$ lsb_release -ds Ubuntu 22.04.5 LTS
1 2}}} </details> -
Build
premake5from downloaded source code package r3-Github1 2 3unzip premake-5.0.0-beta7-src.zip -d premak5-src/ $ cd build/gmake.unix $ make config=release
::: aside
:::References
{{{ 1. [GPT5 - Run app on Ubuntu](https://chatgpt.com/c/69128f99-ff3c-832d-88ab-fe1517ca84db) 2. [Download Premake | Premake](https://premake.github.io/download) 3. [premake-core/BUILD.txt](https://github.com/premake/premake-core/blob/master/BUILD.txt) }}} -
Resize Image
Replace Image in the Original Structure
-
Problems:
- Maintain the same memory address pointer to the image, while substituting an new image with updated width and height.
-
Supports:
-
Resize r1-
::: aside
:::References
{{{ 1. [Rendering a Sphere Using Ray Tracing! // Ray Tracing Series - The Cherno](https://youtu.be/v9vndyfk2U8?list=PLlrATfBNZ98edc5GshdBtREv5asFW3yXl&t=332) }}} -
Render A Ball
-
Problems:
-
Ray hits a ball, and return color value
-
Determine whether a Line intersects a Circle
-
Problems:
-
Supports:
-
Parametric equations:
+———————-+——————————+——————————-+ | | Ray | Circle | +======================+==============================+===============================+ | Function | $y = x$ | $(x-a)^2 + (y-b)^2 = r^2$ | +———————-+——————————+——————————-+ | Parametric | (Origin, Direction, Len) | | | equations in | | | | Vector form | | | +———————-+——————————+——————————-+ | Parametric | $x = o_x + d_x t$
| | | equations in | $y = o_y + d_y t$ | | | component form | | | +———————-+——————————+——————————-+
-