Commit graph

18 commits

Author SHA1 Message Date
Antoine Martin db84708392 library: core: document camera module 2020-03-22 00:14:25 +01:00
Bruno BELANYI 552c0cb966 library: implement refraction
This necessitated to rework how light properties for a material were
given. A material can have either reflectivity or transparency. This
changes the parsing of materials, using a `LightProperty` structure at
its core.

This is does not implement the true Fresnel equations to take into
account the amount of reflection that an incident goes through when
encountering a transparent object.
2020-03-19 18:23:20 +01:00
Bruno BELANYI 08d6d7c262 library: core: color: add clamp method 2020-03-18 23:18:58 +01:00
Bruno BELANYI f9c86639ce library: core: film: fix x/y ratio mix-up
The X axis is the left-right axis. The Y axis is the up-down axis.
2020-03-18 18:06:13 +01:00
Bruno BELANYI 076118edaa library: core: camera: add deserialization 2020-03-18 13:03:12 +01:00
Bruno BELANYI 0644d453b8 library: core: color: add deserialization 2020-03-18 13:03:02 +01:00
Bruno BELANYI 58f9a508dc library: core: color: add image::Rgbconversion 2020-03-17 23:28:24 +01:00
Bruno BELANYI e9eaabcd0a library: core: color: add derive Sum 2020-03-17 23:27:57 +01:00
Bruno BELANYI 7dc622b9e7 library: core: film: add width/height methods 2020-03-17 23:25:29 +01:00
Bruno BELANYI 4c7085ab16 library: core: film: use float for pixel_ratio 2020-03-17 23:24:48 +01:00
Bruno BELANYI 7112873715 library: replace super::super by crate import
Done with the following shell command:
`sed -e 's/super::super/crate/' -i $(git grep -l super::super)`.

Followed by a `cargo fmt --all`.
2020-03-17 20:49:30 +01:00
Bruno BELANYI 48b3f03d40 library: core: color: add Mul-like ops by self 2020-03-17 19:17:52 +01:00
Bruno BELANYI 2dd5c675af library: core: add Camera implementation 2020-03-17 19:17:52 +01:00
Bruno BELANYI a4caa456ce library: core: add Film implementation 2020-03-17 19:17:52 +01:00
Bruno BELANYI 7d28e21a70 library: move from f64 to f32
They are faster to compute with, take less space --which means faster
access because we use less cache lines--, and they are what is used by
`bvh`...
2020-03-16 17:26:04 +01:00
Bruno BELANYI 31272bceac library: core: color: add arithmetic operations
The only operations that are not supported right now are term-by-term
division and multiplication between two colors.

I deemed the multiplication and division by a scalar more important than
those operations for the moment.
2020-03-16 16:14:40 +01:00
Bruno BELANYI b89631adce library: core: add LinearColor type 2020-03-16 15:16:37 +01:00
Bruno BELANYI ecde825407 library: add core module 2020-03-16 15:16:20 +01:00