File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Change Log -- Ray Tracing in One Weekend
13
13
### _ The Next Week_
14
14
- Fix: ` shared_ptr ` dereference and simplify code in ` hittable_list::bounding_box() ` (#435 )
15
15
- Fix: Erroneous en-dash in code block. Replace ` –> ` with ` -> ` (#439 )
16
+ - Fix: Introduce ` u ` ,` v ` surface coordinates to ` hit_record ` (#441 )
16
17
- Fix: Add highlight to new ` hittable::bounding_box() ` method (#442 )
17
18
18
19
Original file line number Diff line number Diff line change 898
898
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
899
899
[Listing [texture]: < kbd> [texture.h]</ kbd> A texture class]
900
900
901
+ We'll need to update the `hit_record` structure to store the U,V surface coordinates of the
902
+ ray-object hit point.
903
+
904
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
905
+ struct hit_record {
906
+ vec3 p;
907
+ vec3 normal;
908
+ shared_ptr< material> mat_ptr;
909
+ double t;
910
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
911
+ double u;
912
+ double v;
913
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
914
+ bool front_face;
915
+ ...
916
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
917
+ [Listing [hit-record-uv]: < kbd> [hittable.h]</ kbd> Adding U,V coordinates to the `hit_record`]
918
+
901
919
< div class='together'>
902
920
Now we can make textured materials by replacing the vec3 color with a texture pointer:
903
921
You can’t perform that action at this time.
0 commit comments