You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the second book, the lambertian material is converted from taking a color in the constructor to a texture, changing this:
lambertian(const color& a) : albedo(a) {}
to this
lambertian(shared_ptr<texture> a) : albedo(a) {}
In the process, the reader is told to go back over their code and update all lambertian values to now use the new solid_color texture where they used to have color, so
Add alternative constructors that take color arguments in addition to
the constructors that take shared_ptr<texture> arguments, simplifying
calling code. This applies to the following clases:
- checker_texture
- constant_medium
- diffuse_light
- lambertian
Resolves#516
In the second book, the
lambertian
material is converted from taking acolor
in the constructor to atexture
, changing this:to this
In the process, the reader is told to go back over their code and update all
lambertian
values to now use the newsolid_color
texture where they used to have color, soshould get updated to
Seems like it would be easier to have two
lambertian
constructors, like so:The result is that the lambertian can take either color or texture, and the reader doesn't have to go back to update everything.
The text was updated successfully, but these errors were encountered: