summaryrefslogtreecommitdiff
path: root/racer-tracer/src/vec3.rs
AgeCommit message (Collapse)Author
2023-04-16โœจ Add support for camera configurationSakarias Johansson
Also decided to not use glam and just do the math myself. Just didn't want an entire library for such a small thing. Probably goint to replace Vec3 at some point, just not now.
2023-04-14โœจ Add support for camera rotationHEADmainSakarias Johansson
Before you could only move the position of the camera. - Add support for turning camera by holding down left mouse. - Add support for turning camera with arrow keys. - Add Mouse move callback for key_inputs.
2023-04-05๐Ÿ™ƒ Tried this, was not worth the performanceSakarias Johansson
Did a test where I removed all the operators for vec and forced the user to use functions on the vector instead that mutated the existing vector. You had to manually call clone if you actually wanted a new vector. No automatic copies were done. Expected the performace to increase by quite a bit since most of the operations are vector operations. Chaining operations like the following just mutated the existing vector. ``` vec.mul(vec2).div(2).add(vec3); ``` Could do this pattern for most things. Turns out is's not such a big deal. Set up a test case of the simple scene with 3 balls. The difference in performance was about 1%. Got surprised and made a more complex scene with over 400 objects expecting to get a bigger difference. Nope. Still 1%. Decided it was not worth it since it was a bit more annoying working with the vectors. Probably get better performance gains with SIMD or using the GPU.
2023-03-14๐Ÿงน Misc cleanupSakarias Johansson
- Was pointless to have one event for render and one for cancel. Reduced it to one while fixing a minor bug. - Remove useless dereference and borrow. Not sure how it ended up like that. - Moved around some code.
2023-03-13๐Ÿ“ธ Add Camera defocus blur + OtherSakarias Johansson
Just wanted to add defocus blur but ended up changing a bunch of other this as well. - Moved scenes to a separate folder. - Updated readme with more pretty images. - Add interface for loading scenes. There is currently one for yaml and another if you want a slightly random scene. - Add image action to decide what to do with the final image once its rendered. Currently supports just showing the buffer until you press the render buffer again and saving the image as `png`. - When you use nix shell you will be dropped in the proper folder so you can just do cargo build etc without having to do `cd`.
2023-03-03โœจ Add image save supportSakarias Johansson
Once the render is done it saves an PNG.
2023-01-19๐Ÿ’š Add CI workflowsSakarias Johansson
2023-01-18๐Ÿ™๏ธ Add support for reading scene from fileSakarias Johansson
2023-01-16๐ŸŽจ Add dialectric materialSakarias Johansson
2023-01-12๐Ÿงน Minor cleanupSakarias Johansson
- Made the traits into supertraits so we don't have to mention Send and Sync everywhere. - Add methods for Vec3 that modifies the existing Vector. Can be used to make less copies.
2023-01-12๐Ÿ–Œ๏ธ Add materialsSakarias Johansson
2023-01-08๐ŸŒ Add GeometrySakarias Johansson
- Created a trait for all geometry that has to implement a hit function. Depending on if the ray hits or not it returns an option with the color. - Add support for multiple samples per pixel Current issues: - Using cooperative multitasking which isn't that helpful in this situation since it's like running without async but without overhead. Should switch to rayon. - All data gets copied once per job. Will decide later what to do (copy or put locks and share data between jobs).
2023-01-06โ˜ Add skySakarias Johansson