README.md aktualisiert

This commit is contained in:
Turingon 2024-02-27 13:10:04 +00:00
parent 7ad32579b9
commit 0371842a00

View file

@ -39,20 +39,20 @@ To understand computer graphics better I will try to describe some important def
By the end of this chapter I generated the following background:
<img src="https://media.discordapp.net/attachments/1185146037774602320/1203455065361489920/image.png?ex=65d127de&is=65beb2de&hm=236433d19502d5b96e041838afe58191f4242f27a79abe32b8689ff80799b64c&=&format=webp&quality=lossless" alt="Second PPM image" width="480"/>
<img src="https://raytracing.github.io/images/img-1.02-blue-to-white.png" alt="Second PPM image" width="480"/>
### Chapter 4: Creating a sphere
In this chapter I created a simple sphere and detect its surface by solving quadratic equations, which represent vectors. The sphere has no shading yet:
<img src="https://media.discordapp.net/attachments/874752364698013736/1205930050038403072/image.png?ex=65da28e1&is=65c7b3e1&hm=26cef89e81f0810588599d6bf0db72b91b42d50789618968186b45459f501eb4&=&format=webp&quality=lossless" alt="Second PPM image" width="480"/>
<img src="https://raytracing.github.io/images/img-1.03-red-sphere.png" alt="Second PPM image" width="480"/>
### Chapter 5: Surface normals
The first part of the chapter was the calculation and visualization of the normals, which we need for shading. But I also implemented the [fast inverse square algorithm](https://youtu.be/p8u_k2LIZyo) in Go just like in Quake III, which is pretty clever and fast. I did primarily because 1) I'm working with 32-bit floats for the sake of memory efficiency and 2) I don't care about accuracy - also it's very educational. But [as explained in this video](https://youtu.be/tmb6bLbxd08) the fast inverse square isn't always the better choice and in my case it probably isn't, because I need to import a Go standard library to disable data type safety and processor padding (something I've noticed when working with small data types in Zig). This is the first visualization of the normals of the sphere:
<img src="https://media.discordapp.net/attachments/874752364698013736/1206571608878350336/image.png?ex=65dc7e60&is=65ca0960&hm=546d9e13e5158c40d52b0a5063d27501a682ba6e71283219cf7e343c9d907588&=&format=webp&quality=lossless" alt="Second PPM image" width="480"/>
<img src="https://raytracing.github.io/images/img-1.04-normals-sphere.png" alt="Second PPM image" width="480"/>
The second part of the capter involved standardizing the code so that it can process multiple objects - it was quite translating this part into Go, as a lot of C++ OOP features are missing - but finally I managed to produce this neat output:
<img src="https://media.discordapp.net/attachments/874752364698013736/1212022000030326814/image.png?ex=65f05273&is=65dddd73&hm=84ce2882f64629c79103940594c43c9b85d19f6819fe766f84b4f65f393cb392&=&format=webp&quality=lossless" alt="Second PPM image" width="480"/>
<img src="https://raytracing.github.io/images/img-1.05-normals-sphere-ground.png" alt="Second PPM image" width="480"/>