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
1313### _ The Next Week_
1414- Fix: ` shared_ptr ` dereference and simplify code in ` hittable_list::bounding_box() ` (#435 )
1515- Fix: Erroneous en-dash in code block. Replace ` –> ` with ` -> ` (#439 )
16+ - Fix: Introduce ` u ` ,` v ` surface coordinates to ` hit_record ` (#441 )
1617- Fix: Add highlight to new ` hittable::bounding_box() ` method (#442 )
1718
1819
Original file line number Diff line number Diff line change 898898 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
899899 [Listing [texture]: < kbd> [texture.h]</ kbd> A texture class]
900900
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+
901919< div class='together'>
902920Now we can make textured materials by replacing the vec3 color with a texture pointer:
903921
You can’t perform that action at this time.
0 commit comments