-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
77 lines (39 loc) · 2.38 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
xorshift32 for pseudorandom https://en.wikipedia.org/wiki/Xorshift
reference single rng
each thread gets own rng but make them static and just next random instead of spawning new rng each time needed
rayon to parallelize
https://deterministic.space/high-performance-rust.html
https://likebike.com/posts/How_To_Write_Fast_Rust_Code.html
notice if let , get over indexing [i]
persistent immutable stuff with pointers
https://stackoverflow.com/questions/39219961/how-to-get-assembly-output-from-building-with-cargo
notice emit asm for better llvm optimizing
https://www.reddit.com/r/rust/comments/k0qzcf/a_raytracer_written_in_rust/
https://www.reddit.com/r/rust/comments/k0qzcf/a_raytracer_written_in_rust/gdl6vn4/
https://github.com/IceSentry/raytracing-weekend-rs/blob/master/src/renderer.rs
https://github.com/daniel5151/vrai-tracer
https://github.com/nsauzede/realist/pull/5/commits/a2187f18fc6379742e1d9a5253aa6af52f272a94
https://github.com/JDuchniewicz/rustracing/pull/1/commits/e83b3585381ae67a4aebdc646a4b41dca38a5161
https://github.com/JDuchniewicz/rustracing/pull/1
https://stackoverflow.com/questions/31012923/what-is-the-difference-between-copy-and-clone
Notie Copy requires Clone but they do different things; copy means not move
cfg debug for easier debug
scene.rs for random scene, cornell, etc
add triangles and stuff
render.rs
chill with the Rc pointers
u8 as the color
https://github.com/perliedman/raytracing-in-one-weekend/blob/aa641d43e1540b05d2cfb500f8c4a0a64ec9f9f9/src/renderer.rs
example of parallel iterators and maps
https://www.reddit.com/r/rust/comments/kbec6h/polymorphism_in_rust_enums_vs_traits/gfi2gnu/
An enum is a closed set of types, with an arbitrary number of related properties.
A trait is a closed set of properties, with an arbitrary number of related types.
https://www.forrestthewoods.com/blog/should-small-rust-structs-be-passed-by-copy-or-by-borrow/
debug http://psgraphics.blogspot.com/2020/12/debugging-refraction-in-ray-tracer.html
imagemagick: convert x.ppm x.png
gitbash or wsl
$ RUSTFLAGS="--emit asm" cargo build --release && cargo run --release > image_balls.ppm
const and tail call recursion
generic types for vectors
buffer/queue mutex gated pipeline of random numbers that threads take? nondeterministic order
apparenlty glam is good for graphics linalg while nalgebra/ndarray/lapack/blas is for general purpose linalg