T5 Light Source and the Cornell Box (MS5)
Add emitted() method in class material
class material {
public:
virtual ~material() = default;
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
virtual color emitted(double u, double v, const point3& p) const {
return color(0,0,0);
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
virtual bool scatter(
const ray& r_in, const hit_record& rec, color & attenuation, ray& scattered
) const {
return false;
}
};Add Emissive Material
Add Background Colour to class camera
Turn Objects into Lights
Build and Run

Build the Cornell Box
Build and Run

Last updated