Skip to content
Snippets Groups Projects
Commit 0c102ae9 authored by Yoel's avatar Yoel
Browse files

Changed scatter and implemented new calcLightMulti-func

parent ea29da38
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,15 @@ util::Vec3 BackgroundMaterial::scattered_d(const util::Vec3& d, ...@@ -20,7 +20,15 @@ util::Vec3 BackgroundMaterial::scattered_d(const util::Vec3& d,
const util::Vec3& n) const { const util::Vec3& n) const {
return util::Vec3(0, 0, 0); return util::Vec3(0, 0, 0);
} }
bool BackgroundMaterial::scatter() const { bool BackgroundMaterial::scatter(const util::Vec3& d,
const util::Vec3& n) const {
return false; return false;
} }
float BackgroundMaterial::calculateLightMultiplier(const util::Vec3& d_in,
const util::Vec3& d_out,
const util::Vec3& n) const {
// Background should not be able to receive any light
return 0;
}
} // namespace material } // namespace material
\ No newline at end of file
...@@ -12,7 +12,11 @@ class BackgroundMaterial : public Material { ...@@ -12,7 +12,11 @@ class BackgroundMaterial : public Material {
util::Vec3 emission(float texel_x, float texel_y) const override; util::Vec3 emission(float texel_x, float texel_y) const override;
util::Vec3 scattered_d(const util::Vec3& d, util::Vec3 scattered_d(const util::Vec3& d,
const util::Vec3& n) const override; const util::Vec3& n) const override;
bool scatter() const override; bool scatter(const util::Vec3& d, const util::Vec3& n) const override;
float calculateLightMultiplier(const util::Vec3& d_in,
const util::Vec3& d_out,
const util::Vec3& n) const override;
private: private:
std::shared_ptr<util::Sampler> texture; std::shared_ptr<util::Sampler> texture;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment