Compare commits

..
50 Commits
Author SHA1 Message Date
Camden Dixie O'Brien c8ca24e572 Tweak demo scene 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f386270842 Allow negative sky colour to be specified 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien fd1a1e0f5a Create multiple demo programs 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 139ff40f12 Add area light material 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 42976ef40b Allow -1 to be passed for auto focal length 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien fad9dca35e Set absorbed colour in material scatter function 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f89a779b8f Add camera aperture / depth-of-field 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f32ec378a3 Add PNGs to .gitignore 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f66e306e8f Add rng_xy() 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 36bca27462 Rename rng_disc() to rng_plusminus() 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f35cb77630 Adjust camera to focus at target 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien d891320a2a Move rendering functions to own module 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 43670cbfba Randomise scene 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 7299dff677 Increase MAX_ITER in camera 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 6c832324e2 Create scene data structure 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 30472cd7f6 Change sky colour 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 4b093f43b6 Allow camera position and target position to vary 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 483dab82ef Remove focal_len parameter from camera (hard-code as 1.0) 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 37d9b9e823 Specify camera FOV instead of viewport height 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien d47e7d7d9d Add fuzz parameter to reflective material 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 746b902302 Make samples per pixel a camera parameter 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 73028df5b3 Add dielectric material 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 313619d8d5 Add progress output 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien c12ae7b4a5 Tweak demo scene a little 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 3b6bc953b5 Add reflective material 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 7f1103a179 Create material abstraction 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 219219ce64 Gamma correct pixels before writing out 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 31adfd66f4 Implement Lambertian diffuse scattering 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien d8a2b8a3d8 Implement Gaussian anti-aliasing 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 259f0922b3 Parallelise rendering 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien d07ccec5ba Sample each pixel multiple times 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 790882417a Implement diffuse scattering 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien bbe7744088 Prevent potential divide by zero in vec3_unit() 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien f4fcdc8a02 Implement RNG module 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien ca8166e98e Simplify hit detection logic 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 6a6fc20dac Move rendering logic into camera module 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien fca3c433ba Handle hits on multiple objects 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien d9cef496cb Add "ground" to demo scene 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 6eb4da9e06 Add front/back face detection 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 77723aefa0 Move camera initialisation into seperate module 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 08f1a2a4dc Create obj module for scene objects 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 0ea0c1edd2 Colour sphere based on normal 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 58e3a869bb Implement simple intersection detection with sphere 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 9da18b734f Set up camera and bg in demo 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 0d3871ff24 Create vec3 module 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 1e0ccabeb0 Add license (Komorebi) 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 2cab9b06c7 Write simple CMake build config 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 2447c2bcac Add .gitignore for build directory and output images 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien 9b578c4e59 Create initial demo writing an image 2025-09-23 15:35:26 +01:00
Camden Dixie O'Brien e58e5c3967 Write simple farbfeld-writing module 2025-09-23 15:35:26 +01:00
4 changed files with 0 additions and 37 deletions
-1
View File
@@ -1 +0,0 @@
demo.png filter=lfs diff=lfs merge=lfs -text
-1
View File
@@ -1,4 +1,3 @@
build/
*.ff
*.png
!demo.png
-32
View File
@@ -1,32 +0,0 @@
# Batomorph
Batomorph is a simple ray tracer, written in C23 for POSIX systems.
![Demo rendering](demo.png)
To build with CMake (there are no dependencies):
```sh
cmake -B build
cmake --build build
```
You may want to adjust the `NTHREADS` definition in `src/render.c` to
match your system.
The demo programs (`build/demo` and `build/rand`) will write the
rendered image in sRGB
[Farbfeld](https://tools.suckless.org/farbfeld/) to `stdout`:
```sh
build/demo > out.ff # Produce Farbfeld file
build/demo | ff2png > out.png # Produce PNG file
build/demo | feh # View directly
```
(Note that `ff2png` and `feh` are third-party programs)
## License
Batomorph is Copyright © Camden Dixie O'Brien, and is available under
the Komorebi 2.0.0 license. See [LICENSE.md](LICENSE.md) for details.
BIN
View File
Binary file not shown.